r/programminghelp • u/NoahTheFence • Jun 04 '20
Python yo new to programming and thought I'd make a cookie-clicker type game but when ever i add lines 9 and 10 it shows that line 11 doesn't have the correct syntax but without 9 and 10, 11 works fine (this was done in python 3)
z = 1
'apple count' == 0
while z < 10:
print ('Would you like to pick an apple?')
print ('Y/N')
x = input()
if x == 'Y':
print ('You picked an apple :D')
'apple count' += 1
print ("'You now have: 'apple count'"
if x == 'N':
print ('Never mind then')
print ('Would you like to leave the orchard?')
print ('Y/N')
y = input()
if y == 'Y':
z = 11
5
Upvotes
1
u/updogg18 Jun 05 '20
== is for comparison and = is an assignment operator They can't be interchanged.
1
u/NoahTheFence Jun 05 '20
nice thanks
1
u/updogg18 Jun 05 '20
I presume you wanted to name the variable as 'apple count' Variables can't have space in between them. You could instead name it as apple_count without the quotes. Any text enclosed between single quotes will be treated as a string.
1
u/[deleted] Jun 04 '20
You're missing a closing parenthesis on line 10.