Consider the following code (I received a name error when running this)
item = input("What food???")
def itemcheck():
if item == "chex":
cereal = "Yummy"
else:
cereal = "Yuck!"
itemcheck()
print(cereal)
the error was name 'cereal' is not defined. What error am I making/how do I fix it? What is the correct way to define a variable in your own function?