Python objects have an inherent True or False value : bool « Buildin Function « Python Tutorial






print bool(1)
print bool(True)
print bool(0)
print bool('1')
print bool('0')
print bool([])
print bool ( (1,) )








13.4.bool
13.4.1.Convert a value to a Boolean, using the standard truth testing procedure.
13.4.2.Python objects have an inherent True or False value