import random print("\nRandom Food Generator") firstName = input("\nwhat is your first name: ") lastName = input("\nwhat is your last name: ") print("\nHello, ", firstName, lastName) hungerStatus = input("are you hungry?: Y/N ") print(hungerStatus) if hungerStatus == "y" or hungerStatus == "Y": print("\n",firstName, lastName,"What would you like to eat? ",) print('\npizza', '\nfruit salad', '\ntuna', '\ncurrant slice') foodOptions = input["pizza", "fruit salad", "tuna", "currant slice"] choiceOfFood = input("") else: print("\nYou are not hungry") if choiceOfFood == foodOptions: print(choiceOfFood)
Yes that is what i intended to write with input. It worked for over a month but now it gets a typeError at line 17
I’m not sure there was any version of Python where that would work. The error is there for a reason, you’re doing something that can’t be done, you cannot use
input like that; it’s intended to be used as a callable, e.g.
foodOptions supposed to be here, what is your intention?
foodOptions is a list. Thank you, ive found my error, you were correct. i must of added that input without realising at some point