[Tutor] true and false

Alan Gauld alan.gauld at freenet.co.uk
Mon Aug 7 23:07:20 CEST 2006


> What values represent true in Python?

True

Its a built-in boolean type value.

But empty strings, lists, tuples etc are considered False
Similarly zero and None are considered False

The library reference has a full list somewhere, but it's pretty 
much what intuition would tell you. "Empty" things are false 
anything else is true.

Alan G.


More information about the Tutor mailing list