a==14
is not a statement, it’s an expression. It produces a boolean result, that is discarded as soon as it is produced. It is a line that has absolutely no effect on the program.
On the other hand, there is no ===
operator in python, that’s why your program fails in that case. Contrary to javascript, python is a strongly typed language, it does not do implicit conversions. The ==
of python is similar to ===
in javascript.
1
solved Can someone explain why this compiles? [duplicate]