+ 1
If statement
Why this code shows invalid syntax? if s/p=0: “I have variables called s and p”
6 ответов
+ 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 😉