+ 1

Question

>>> num=7 >>> if num==5: print(“number is 5”) else: Syntax error: invalid syntax

23rd May 2018, 4:24 PM
Pragya Singh
Pragya Singh - avatar
2 Answers
+ 3
Is there a line after this line? else: If not, remove the else or: else: pass
23rd May 2018, 4:38 PM
Paul
Paul - avatar
+ 1
Just after else it gives a syntax error
23rd May 2018, 4:44 PM
Pragya Singh
Pragya Singh - avatar