"""author: @pythonpips"""

colors = ['red', 'orange', 'green', 'blue']

if 'green' in colors:
    print('Yes')
else:
    print('No')

# outputs: 'Yes'
How to Check If an item is in the List in Python

Subscribe to our newsletter