Posts

Showing posts from June, 2013

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