I'm trying to learn python and am having trouble writing this program. I every time I try to run it I get a syntax error.
What am i doing wrong
pic related
>>18007568
I don't know python, but where do you declare the 'cake' variable? Because you have 'cakes' and no 'cake'.
>>18007568
Should be cake = int(... etc. not cakes
>>18007568
>learns python over a real language like c#
>expects us to not think you are a cuck
You didn't defy "cake" as a variable, only "cakes". You're getting a syntax error because the interpreter doesn't know what "cake" is.
You're also writing the ranges wrong. You need to delete the "and" and replace it with your input variable ... if (number) (<, <= , > , =>) "cake" (<, <=, >, =>): then enter your print() message below
You have to start with "if", because you have three outcomes that can come from user input in your program. This would be the correct program.
cake= int(input("how many cakes do we have?" ))
if 15 <= cake <= 20:
print("whos there, that's way too many cakes!")
if 5 <= cake < 15:
print("Okay, that's probably enough cakes.")
if 0 <= cake < 5:
print("I think we're going to need to get some more cakes.")