+ 1
if statement error
n=10 if n=10: print('big') when I run the code if shows invalid syntax on if n=10: line
2 Antworten
+ 4
Hello body!
It's easy. You should use double equal signs in if statement.
In fact we do NOT want to assign a value to a variable in IF statements.
But we want to compare 2 or more values with each other. So we need to use comparison signs (==) instead of assignment signs (=).
And that's why the IF will come in.