-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathBartender.py
36 lines (30 loc) · 1.15 KB
/
Bartender.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
import random
questions = {
"strong": "Do ye like yer drinks strong?",
"salty": "Do ye like it with a salty tang?",
"bitter": "Are ye a lubber who likes it bitter?",
"sweet": "Would ye like a bit of sweetness with yer poison?",
"fruity": "Are ye one for a fruity finish?"
}
ingredients = {
"strong": ["glug of rum", "slug of whisky", "splash of gin"],
"salty": ["olive on a stick", "salt-dusted rim", "rasher of bacon"],
"bitter": ["shake of bitters", "splash of tonic", "twist of lemon peel"],
"sweet": ["sugar cube", "spoonful of honey", "spash of cola"],
"fruity": ["slice of orange", "dash of cassis", "cherry on top"]
}
def MakeDrink():
result = []
for key, question in questions.items():
while(True):
answer = raw_input(question)
if(answer.lower() in ("ok", "yes")):
result.append(random.choice(ingredients[key]))
break
elif(answer.lower() in ("no")):
break
else:
print("Beg your parden?")
return result
if __name__ == '__main__':
print(MakeDrink())