Fav_Food_List = ['Pizza','Burger','Cake',] Favourite_Food = input("Enter name of your favorite food") for Favourite_Food in Fav_Food_List: if Fav_Food_List == Favourite_Food : print ("Yep! So amazing!") else: print("Yuck! That's not it!") print("Thanks for playing!")
Advertisement
Answer
You can do this:
Favourite_Food = input("Enter name of your favorite food") if Favourite_Food in Fav_Food_List: print ("Yep! So amazing!") else: print("Yuck! That's not it!") print("Thanks for playing!")```