March 2003
Intermediate to advanced
656 pages
39h 30m
English
bool — Python 2.2 and later
bool(x)Returns 0, also known as False,
if argument x evaluates as false; returns
1, also known as True, if
argument x evaluates as true. See also
Section 4.2.6 in Chapter 4. In Python 2.3, bool
becomes a type (a subclass of int), and built-in
names False and True refer to
the only two instances of type bool. They are
still numbers with values of 0 and
1 respectively, but str(True)
becomes 'True', and str(False)
becomes 'False', while in Python 2.2 the
corresponding strings are '0' and
'1' respectively.