Oct-25-2020, 04:53 AM
Awesome! Thanks so much! I now have a different problem, however. Even after using a valid input, it repeats the function twice. Here's my updated code:
def chooseCoffee (): coffee = "" while coffee != "iced coffee" and coffee != "black coffee" and coffee != "cappuccino": # input validation coffee = input("Choose your coffee (iced coffee, black coffee, or cappuccino): ") return coffee chooseCoffee() coffee = chooseCoffee() if coffee == "iced coffee": print('Cashier: "Iced coffee it is!"') elif coffee == "black coffee": print('Cashier: "Black coffee it is!') elif coffee == "cappuccino": print('Cashier: "Cappuccino it is!')