(Sep-06-2017, 04:17 PM)wavic Wrote: 0 == False evaluates to True because 0, None and an empty value in Python are False.This isn't quite correct.
0
and False
are the same value (not the same object). False
is technically a Boolean type but it is indistinguishable from 0
for all practical purposes.None
and empty sequences on the other hand are falsey values, but they are not equal to False
(or 0
).>>> 0 == False True >>> None == False False >>> () == False False >>>