print(‘Welcome to the cafe!’)
dimension = get_size()
drink_type = get_drink_type()
print(f”Alright, that’s a {dimension} {drink_type}!”)
determine = enter(“Can I get your determine please?n> “)
print(f”Thanks, {determine}! Your drink shall be ready shortly.”)
def get_size():
res = enter(“What dimension drink can I get for you? n[a] Small n[b] Medium n[c] Big n> “)
if res == ‘a’:
return ‘small’
elif res == ‘b’:
return ‘medium’
elif res == ‘c’:
return ‘large’
else:
print_message()
return get_size()
def print_message():
print(“I’m sorry, I didn’t understand your selection. Please enter a reputable chance.”)
def get_drink_type():
res = enter(“What sort of drink would you need? n[a] Brewed Espresso n[b] Mocha n[c] Latte n> “)
if res == ‘a’:
return ‘brewed espresso’
elif res == ‘b’:
return ‘mocha’
elif res == ‘c’:
return order_latte()
else:
print_message()
return get_drink_type()
def order_latte():
res = enter(“What kind of milk in your latte? n[a] 2% milk n[b] Non-fat milk n[c] Soy milk n> “)
if res == ‘a’:
return ‘latte’
elif res == ‘b’:
return ‘non-fat latte’
elif res == ‘c’:
return ‘soy latte’
else:
print_message()
return order_latte()
# Run the espresso bot
coffee_bot()
Thanks for being a valued member of the Nirantara household! We admire your continued assist and belief in our apps.
If you have not already, we encourage you to obtain and expertise these implausible apps. Keep related, knowledgeable, trendy, and discover superb journey affords with the Nirantara household!