I am struggling with this piece of Python code. The problem is,when a user enters something wrong I need my code to keep looping until they input a valid answer. This is how the
Use a while loop and break once you're satisfied:
drink = None
while drink is None:
choice = input("Please enter a drink from the menu above\n").lower()
if choice == "1" or choice == "fanta":
drink = "Fanta"
elif choice == "2" or choice == "coke":
drink = "Coke"
elif choice == "3" or choice == "pepsi":
drink = "Pepsi"
elif choice == "4" or choice == "sprite":
drink = "Sprite"
Order[DRINK] = drink