New course! Every coder should learn Generative AI!
Try a free lesson+ 1
Question
>>> num=7 >>> if num==5: print(“number is 5”) else: Syntax error: invalid syntax
2 Answers
+ 3
Is there a line after this line?
else:
If not, remove the else or:
else:
pass
+ 1
Just after else it gives a syntax error