Feb-05-2020, 07:34 PM
=
isn't equality, it's assignment - i.e. assigning a value to a variable. a = 1
, for example, is a statement. It doesn't return a value; it just sets the value of a
to 1.==
checks whether the values on the left hand and right hand sides are equal. 1 == 2
, for example, is an expression. It does return a value (i.e. False
in this case) and can be used in other expressions.