# Welcome!

By registering with us, you'll be able to discuss, share and private message with other members of our community.

# PythonExpression expected ; Statement expected

#### Pamedi

##### New Coder
So hey guys I am totally new to coding and I tried to make a programm that would show me my recipe for my pancakes etc. if I type a certain number from 1 to 3 in there.
But it came with a couple problems I dont know how to solve since this is my first time. the first is at print(for) and the next one is at the end of the line at ]🙂 appreciate your help in advance and bless you all

portions = 1
Pfannkuchen = '1'
Waffeln = '2'
Schokokuchen = '3'

Rezept = input('Bitte geben Sie Ihr Rezept an: ')

is_Pfannkuchen = 1
is_Waffeln = 2
is_Schokokuchen = 3

if is_Pfannkuchen:
print(for x in [str(portions * 0.5) + '2Eier', '200 g Mehl', '200 ml Milch', '1 Prise Salz', '60 ml Wasser', '1 Prise Zucker']🙂
print(x)

elif is_Waffeln:
print(for x in [str(portions * 0.5) + '3 Eier', '200 g Mehl', '200 ml Milch', '1 Prise Salz', '1 Backpulver', '1 Prise Zucker']🙂
print(x)

elif is_Schokokuchen:
print(for x in [str(portions * 0.5) + '3 Eier', '200 g Mehl', '200 ml Milch', '1 Tafel Schokolade', '1 Backpulver', '1 Prise Zucker']🙂
print(x)

else:
print('Bitte Geben Sie eine Zahl von 1-3 an')

Could you post the code in English? Maybe I can help then.

Okay I will try thanks, I just imagined some numbers so dont wonder please

portions = 1
Pancake = '1'
Waffels = '2'
cake = '3'

is_Pancake = 1
is_waffles = 2
is_cake = 3

if is_Pancake:
print(for x in [str(portions * 0.5) + '2 eggs', '200 flour g ', '200 ml milk', '5 gramm salt', '60 ml Water', '5 gramm sugar']🙂
print(x)

elif is_Waffles:
print(for x in [str(portions * 0.5) + '3 Eggs', '200 g flour', '200 ml Milk', '5 gramm salt', '1 pack of pulver', '15 gramm sugar']🙂
print(x)

elif is_cake:
print(for x in [str(portions * 0.5) + '3 Eggs', '200 g flour', '200 ml Milk', 'chocolate', '1 pack of pulver', ' 20 gramm sugar']🙂
print(x)

else:
print('Please Type in a number from 1-3 to get your wished recipe')

You are not comparing the input to chosen recipe.

I've modified the code to one way it could be written

Python:
``````portions = 1
pancake = 1
waffles = 2
cake = 3

print('please choose a number from 1 - 3')
recipe = input('>> ') # Get the input
recipe = int(recipe) # Convert to int

# Compare input to one of the numbers entered (recipe)
# assign meg variable
if recipe == 1:
msg = f'Portions: {portions * 0.5} - 3 eggs, 200 g flour, 200 ml milk 5 gram salt, 60 ml water, 5 gram sugar'
elif recipe == 2:
msg = f'Portions: {portions * 0.5} - 3 Eggs, 200 g flour, 200 ml Milk, 5 gramm salt, 1 pack of pulver, 15 gramm sugar'
elif recipe == 3:
msg = f'Portions: {portions * 0.5} - 3 Eggs, 200 g flour, 200 ml Milk, chocolate, 1 pack of pulver, 20 gramm sugar'
else:
msg = 'Invalid input'

# Print the msg
print(msg)``````

Output
Code:
``````please choose a number from 1 - 3
>> 2
Portions: 0.5 - 3 Eggs, 200 g flour, 200 ml Milk, 5 gramm salt, 1 pack of pulver, 15 gramm sugar``````

Thank you a lot , I appreciate your help ! 🙂 I will use that for the future