Syntax Error in Python 3 if...elif...else statement | Sololearn: Learn to code for FREE!
Neuer Kurs! Jeder Programmierer sollte generative KI lernen!
Kostenlose Lektion ausprobieren
0

Syntax Error in Python 3 if...elif...else statement

I went over my code multiple times and can't figure out what the problem is. I'm new to Python, so maybe there's something I've overlooked or didn't think of. The error message is as follows:: line 20 elif b > a: ^ SyntaxError: invalid syntax Here is my code: https://code.sololearn.com/cF5xsCO7rKkI If anybody can tell me what's wrong with my code, I'd greatly appreciate it. Thank you! Update: I revised the code and changed the format a bit and now it works just fine. Thank you for your help!

10th Aug 2018, 5:06 AM
sky_blue02
sky_blue02 - avatar
3 Antworten
+ 3
you forgot to close the print statement on line 19. Just add a closing ).
10th Aug 2018, 5:38 AM
davy hermans
davy hermans - avatar
+ 1
You have forgotton to close the print in Line 19 with ")"
10th Aug 2018, 5:38 AM
P.W.R.
P.W.R. - avatar
0
Thank you both! I just switched from Python 2 to 3 and Python 2 didnt need the (), so I must have accidentally left one off when adding them in. It’s not useful that the error applied to the next line. In the future, I will look back at lines before the one mentioned in the error message, if there is no obvious error in the line listed.
10th Aug 2018, 5:48 AM
sky_blue02
sky_blue02 - avatar