ID EN
Built-in Functions

bool

Python 3.11

Return a Boolean value, i.e. one of True or False. x is converted using the standard truth testing procedure. If x is false or omitted, this returns False; otherwise, it returns True. The bool class is a subclass of int (see Numeric Types — int, float, complex). It cannot be subclassed further. Its only instances are False and True (see Boolean Values).

Syntax

PYTHON
class bool(x=False)

See Also

truth testing procedure bool int Numeric Types — int float complex Boolean Values