0

I am trying to write a basic program that could tell the user if the element entered by them is present in the list entered by them or not.

My code:

a=(int(x) for x in input().split())
b=input('Enter the element you want to see if is present or not')
if b in a:
   print('Yes it is present')
else:
   print('Try again')

Output: Try Again (In all the cases)

Please help me correct this code and also tell me why if b in a doesnt work but b in a works in the Python shell.

Thanks:)

Vito
  • 3
  • 6

0 Answers0