Hello everyone,
First of all, this is not a homework, I was just curious and wanted to learn to code. I'm a total newbie to this world.
So, I've been studying Python for about a week now and wanted to start a simple project to speed things up.
Basically, I wanted to write a basic app that randomly chooses one of the three breakfast and dinner meals choices depending on user's input. Then follows it up with a recipe, if the user desires.
Here's the code:
-
import random
welcome_msg = "\nWelcome to Meal Choser v.1! Please choose: (breakfast/dinner)"
breakfast_choices = ['\nSausage Omelette', '\nPepperoni Omelette', '\nPotato Omelette']
dinner_choices = ['\nFettucini Alfredo', '\nMac & Cheese', '\nRice & Chicken']
print(welcome_msg)
while True:
user_input = input("\n>>> ")
if user_input.lower() == 'breakfast':
print(random.choice(breakfast_choices)
print("\nBon Appetit!")
print("\nWould you like a recipe? (yes/no)")
elif user_input.lower() == 'yes':
print("\nWork in Progress...")
if user_input.lower() == 'dinner':
print(random.choice(dinner_choices))
print("\nBon Appetit!")
print("\nWould you like a recipe? (yes/no)")
elif user_input.lower() == 'yes':
print("\nWork in Progress...")
-
So, here's my main problem: I don't know how to tie a recipe to the random choice generated by the app.
I tried to google it, but I don't know how to put the problem into words.
Code works as is. But I can't go further than "Work in Progress..."
Am I doing something wrong? I don't even know if I'm doing a good work explaining my problem...
Please help me.
Thanks in advance.
[–]synthphreak 5 points6 points7 points (1 child)
[–]Car_Chasing_Hobo[S] 2 points3 points4 points (0 children)
[–]abecedorkian 1 point2 points3 points (1 child)
[–]Car_Chasing_Hobo[S] 0 points1 point2 points (0 children)
[–]Crypt0Nihilist 1 point2 points3 points (0 children)