Why does python obtain such a result?
>>> 1 in [] == False
False
Obviously, '1 in []'
is evaluated to False
, and 'False == False'
is evaluated to True
. And 1 in ([] == False)
is not valid expression.
On the other hand '(1 in []) == False'
is evaluated to True
, but I still do not understand why '1 in [] == False'
is evaluated to False
,