How to check which list an element is contained in

x = ["i", "hello", "great"]
y = ["what", "food"]
chosen = input("Input a word: ")
if chosen in x:print("x")
if chosen in y:print("y")
elif chosen not in x:print("Not Found!")

Browse More Popular Posts

Leave a Comment