What is the syntax to see if a value is in a list?

<search value> in <array name>
#yields true if value is contained in list

<search value> not in <array name>
#yields true if value is not in list
#examples
>>> 'hello' in ['tulips','roses','daisies']
False

>>> numbers=[1,2,3,4,5]
>>> 6 not in numbers
True

 

 

Advertisements