How do I make this work so that the “for (food_key, food_name), price in order_menu.items():” continues to work, not just once or for that specific item? (Don’t worry about the “end” code)
order_menu = {("C", "Chips (Scoops)") : 2.80, ("F", "Fish (Battered)") : 2.90, ("Fc", "Fish (Crumbed)") : 4.90, ("Fib", "Filet (Battered)") : 6.90, ("Fic", "Filet (Crumbed)") : 6.90,
("Hd", "Hot Dog") : 2.60, ("S", "Sausage") : 2.60, ("Mp" , "Meat Patty (Homemade)") : 3.90, ("Cr", "Crabstick") : 2.50, ("Sr", "Spring Roll (Homemade)") : 2.80,
("Cr", "Curry Roll (Homemade)"): 2.80, ("Pof", "Potato Fritter (Homemade)") : 1.20, ("Paf", "Paua Fritter (Homemade)") : 5.90, ("Cn", "Chicken Nugget") : 1,
("Mh", "Mini Hot Dog (On a stick)") : 1.20, ("Pf", "Pineapple Fritter") : 2.50}
order_dictionary = {}
for (food_key, food_name), price in order_menu.items():
while True:
food_ordered = input("Order: (Type 'end' when you have finished)")
if food_ordered == "end":
break
elif food_ordered in food_key or food_ordered in food_name:
quantity_food = int(input("Number of {}: ".format(food_ordered)))
if quantity_food > 10:
quantity_food_check = int(input("Are you sure you want x{} {}? (re-enter to confirm): ".format(quantity_food, food_ordered)))
order_dictionary[food_ordered] = quantity_food
else:
order_dictionary[food_ordered] = quantity_food
else:
print("Please enter an actual item on the menu!")