Convert a value to a Boolean, using the standard truth testing procedure. : bool « Buildin Function « Python Tutorial






print bool('this is a test')
print bool(42)
print bool('')
print bool(0)








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