Hi! I am pretty new to coding, I am working on a recipe generator and I am having some problems. I’ll show you my code and then I will explain what I am trying to do! Thanks in advance for your help!
import random
first = [‘boiled’, ‘fried’, “stir-fried”, “air-fried”, “raw”]
vegetable = [‘onion’, ‘carrot’, ‘zucchini’, ‘eggplant’, ‘pepper’, “mushrooms”, “tomato”]
protein = [‘tofu’, ‘seitan’, ‘lentils’, ‘chickpeas’, ‘peas’, ‘textured soja protein’, ‘any other vegan meat’]
sauce = [‘tomatosauce’, ‘hummus’, ‘sojasauce’, ‘spicemix’]
spicemix = [‘pepper’, ‘garlic’, ‘paprika’, ‘chili’, ‘cumin’, ‘kurkuma’, ‘thymian’]
print(random.choice(first) + " " + random.choice(vegetable) + " with " + random.choice(protein) + " and " + random.choice(sauce))
if “spicemix” == random.choice(sauce):
print(random.choice(spicemix) + " " + random.choice(spicemix))
Basically, I want it to give me a recipe including “first”, “vegetable”, “protein” and “sauce”, so far, it works. HOWEVER, I want it to give me two spices from “spice mix” when it gives me “spicemix” in “sauce”. Could you please help me?