Created
October 31, 2016 20:55
-
-
Save jmsword/c57d4de0f4fedea6bf1a0b23f6ab0720 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#bartender app | |
import random | |
questions = { | |
"stiff": "Do you like stiff drinks?", | |
"citrusy": "Do you like your drinks scurvy-free?", | |
"sweet": "Are you a sissy who likes fruity drinks?", | |
"bitter": "Do you like your drinks bitter?", | |
"classy": "Do you like your drinks with a twist of class?", | |
} | |
ingredients = { | |
"stiff": ["double shot of whisky", "triple shot of rum", "light on the juice"], | |
"citrusy": ["twist of orange peel", "orange vodka", "lemonade"], | |
"sweet": ["fresh berries", "coconut flakes", "fruit punch"], | |
"bitter": ["splash of bitters", "double shot of gin", "rye whisky"], | |
"classy": ["top shelf vodka with olives", "a jug of wine", "some good ol' bubbly"], | |
} | |
def drink_preference (): | |
preferences = {} | |
for key, value in questions.items(): | |
u_input = input(value + " ") | |
preferences[key] = (u_input == "y" or u_input == "yes") | |
return preferences | |
def drink_maker(preferences): | |
my_drink=[] | |
for key, value in preferences.items(): | |
if value is True: | |
my_drink.append(random.choice(ingredients[key])) | |
return my_drink | |
def main(): | |
result = drink_preference() | |
print("I am going to recommend you have a drink with:") | |
for drink in drink_maker(result): | |
print(" " + drink) | |
if __name__ == "__main__": | |
main() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment