I want to be able to enter a value and check if it is in a list and if it is then in the list run a the rest of the program wanted.
a=input('enter value')
b=(1,2,3,4)
c=(5,6,7,8,9)
if a is in b:
print 'enter in code thats wanted'
You've written it yourself almost correctly, just instead of -
if a is in b:
it should be -
if a in b:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With