+ 1
If statement
Why this code shows invalid syntax? if s/p=0: âI have variables called s and pâ
6 RĂ©ponses
+ 5
To compare numbers you need to use â==â not â=â
+ 1
Thank you
+ 1
cz in comparision you supposed to use equal to operator "=="
hint: use spaces it will make you code more readable
+ 1
The '=' is an assignment operator. The '==' is a comparison operator. Selection (if, elif, else) and repetition (for, while, do while) statements use comparisons for checking.
The proper comparison should be
s / p == 0
0
I forgot that
0
Hanistan
No problem.
Happy coding đ