How come sometimes when you use the 'if' statement and then the 'else' statement, you get a syntax error saying 'else:' is an error? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

How come sometimes when you use the 'if' statement and then the 'else' statement, you get a syntax error saying 'else:' is an error?

syntax error on else statement

15th Aug 2016, 9:38 PM
Andrew Wheatley
Andrew Wheatley - avatar
2 Answers
0
write pass before else and it work
16th Aug 2016, 3:15 AM
Adjed boumediene
Adjed boumediene - avatar
0
I will try that when I get back on my computer. Thanks
16th Aug 2016, 10:23 AM
Andrew Wheatley
Andrew Wheatley - avatar