in list


Check if the value is in the list?


examples/lists/in.py
words = ['apple', 'banana', 'peach', '42']
if 'apple' in words:
    print('found apple')

if 'a' in words:
    print('found a')
else:
    print('NOT found a')

if 42 in words:
    print('found 42')
else:
    print('NOT found 42')

# found apple
# NOT found a
# NOT found 42