-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathscript.py
46 lines (33 loc) · 1.05 KB
/
script.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
from utils import print_message, get_size, order_latte, order_mocha
def coffee_bot():
print('Welcome to the cafe!')
order_drink = 'y'
drinks = []
while order_drink == 'y':
size = get_size()
drink_type = get_drink_type()
drink = '{} {}'.format(size, drink_type)
print('Alright, that\'s a {}!'.format(drink))
drinks.append(drink)
while True:
order_drink = input('Would you like to order another drink?\n(y/n)')
if order_drink == 'y' or 'n':
break
print('Okay, so I have: ')
for drink in drinks:
print('-', drink)
name = input('Can I get your name please? \n> ')
print('Thanks, {}! Your order will be ready shortly.'.format(name))
def get_drink_type():
res = input('What type of drink would you like? \n[a] Brewed Coffee \n[b] Mocha \n[c] Latte \n> ')
if res == 'a':
return 'brewed coffee'
elif res == 'b':
return order_mocha()
elif res == 'c':
return order_latte()
else:
print_message()
return get_drink_type()
# Define new functions here!
coffee_bot()