The program is stuck at the first input, also won't respond to while True
available_toppings = ["mushrooms", "olives", "pepperoni", "pineapple"]
print(f"Hello! please choose from the available toppings:\n{available_toppings[0].title()}\n{available_toppings[1].title()}\n{available_toppings[2].title()}\n{available_toppings[3].title()}\n")
requested_toppings = input("Please choose your topping:\n")
def program():
if requested_toppings in available_toppings:
print(f"Adding {requested_toppings}..")
else:
print(f"Sorry, {requested_toppings} is not available!")
while True:
program()
if input("Do you want to add another topping? (Y/N)\n").strip().upper().lower() == "N":
break
print("Finished making your pizza!")
The program should print(f"Adding{requested_toppings}..")
if the user input is a value that exists in available_toppings
else print(f"Sorry, {requested_toppings} is not available!")
if it's not. Then ask the user if they want to add another topping. If not (N), the loop breaks and print("Finished making your pizza!")
Instead it's stuck at the first input.