-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathutils.py
39 lines (33 loc) · 1000 Bytes
/
utils.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
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'
elif res == 'b':
return 'medium'
elif res == 'c':
return 'large'
else:
print_message()
return get_size()
def order_latte():
res = input('And 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 'latte'
elif res == 'b':
return 'non-fat latte'
elif res == 'c':
return 'soy latte'
else:
print_message()
return order_latte()
def order_mocha():
while True:
res = input('Would you like to try our limited-edition peppermint mocha? \n[a]Sure! \n[b]Maybe next time! \n> ')
if res == 'a':
return 'peppermint mocha'
elif res == 'b':
return 'mocha'
else:
print_message()