Empty strings "" and zero 0 are treated as False in python

>>> any ([0, 0])
False
>>> any ([1, 0])
True
>>> any ([None, 0, ""])
False
>>> bool(0)
False
>>> bool("")
False
>>> bool(1)
True

Comments

Popular posts from this blog

Multiple repeat error when the regex has multiple wildcards in python re module

Weakref proxy is for instance only ...

To speed up accessing files on nfs shares on a ubuntu machine ...