Skip to content
Sign upLog in
← Back to Community

syntax error?

Profile icon
RileyMears

it says on line 56 there is a syntax error with a print statement although there is nothing wrong? can someone please help me

Answered by Coder100 [earned 5 cycles]
View Answer
Voters
Profile icon
RileyMears
Comments
hotnewtop
Profile icon
Coder100

Error

image


forgot a little ). No worries, we all make these silly mistakes!

Solution

print (str(num1) + " / " + str(num2))
Profile icon
RileyMears

@Coder100
thanks at first i forgot to do the str so i was adding them and i kinda rushed through the first few and forgot a ) lol

Profile icon
Coder100

lol np :)
mark as correct answer please!

@RileyMears

Profile icon
RileyMears

@Coder100
what are cycles?

Profile icon
Coder100

just useless internet points
if you are redditor you can think of them like karma lol

@RileyMears

Profile icon
WillBrighton

i don't know why it says syntax error can someone help me.
for i in range (1, 101):
print(i, end=' ')
if i%3 == 0:
if i%5 == 0:
print("Fizz Buzz")
else:
print("Fizz")
elif i%5 == 0:
print("Buzz")
else:
print('not dividable')

Profile icon
SkullYT

@WillBrighton
do you have correct tab spacing? if so, it might be the end='' in the print statement, which you can just move out of the print statement, the first if statement after the first print statement doesnt have anything after it, so if you want it to do nothing, you can put "continue"(no quotations) after the if statement. im not an expert by any means, I am only self taught and am still in high school, but these might be possible problems in your code.