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!
3 Answers
+ 3
you forgot to close the print statement on line 19. Just add a closing ).
+ 1
You have forgotton to close the print in Line 19 with ")"
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.