Python In

Python in is used to test if a value is present in a sequence

>>> x = 3
>>> x in [5, 3, 8]
True
>>> x in [8, 9, 12]
False

It can be used to test if a value is present in a list, a tuple, or a set:

>>> 3 in (3, 8, 9)
True
>>> 3 in set([3, 8, 9])
True

It can also be used to test if a key is present in a dictionary:

>>> 'a' in {'a': 3, 'b': 4}
True
>>> 'a' in {'b': 3, 'c': 4}
False