Python - Search item between list with in operator

Description

Search item between list with in operator

Demo

items = ["aaa", 111, (4, 5), 2.01]      # A set of objects 
tests = [(4, 5), 3.14]                  # Keys to search for 
# from w w  w . j  a  v  a  2s  .c om
for key in tests:                       # For all keys 
    if key in items:                    # Let Python check for a match 
        print(key, "was found") 
    else: 
        print(key, "not found!")

Result

Related Example