Hello. I have a little problem with this exercise. I dont understand where is a mistake.
i have a NameError: order_latte is not defined. Maybe someone can help me. Thank you for help.
def coffee_bot():
print("Welcome to the cafe!")
coffee_bot()
def print_message():
print("I'm sorry, I did not understand your selection. Please enter the corresponding letter for your response.")
def get_size():
res = input('What size drink can I get for you? \n[a] Small \n[b] Medium \n[c] Large \n> ')
if res == 'a':
return 'small'
if res == 'b':
return 'medium'
if res == 'c':
return 'large'
else:
print_message()
return get_size()
size = get_size()
print(size)
def get_drink_type():
res = input("What type of drink would you like? \n[a] Brewed Coffe \n[b] Mocha \n[c] Latte \n> ")
if res == 'a':
return "Brewed Coffe"
if res == 'b':
return 'Mocha'
if res == 'c':
return order_latte()
else:
print_message()
return get_drink_type()
drink_type = get_drink_type()
print(drink_type)
def order_latte():
res = input("What kind of milk for your latte? \n[a] 2% milk \n[b] Non-fat milk \n[c] Soy milk \n> ")
if res == 'a':
return '2% milk'
if res == 'b':
return 'Non-fat milk'
if res == 'c':
return 'Soy milk'
else:
print_message()
return order_latte()
latte_options = order_latte()
print(latte_options)
when I use answer c in the second step this error occurs