September 2026
1051 pages
35h 4m
English
An instance of the bool[ 40 ] data type can have only two different values: true or false—or, to stay within the Python syntax, True or False. For this reason, it’s absurd to categorize bool as a numeric data type at first glance. As is common usage in many programming languages, in Python, True is regarded as similar to 1 and False as similar to 0, so that Boolean values can be calculated in the same way as, for example, integers. The names True and False are constants that can be used in the source code. Note especially that the constants start with an uppercase letter:
v1 = Truev2 = False
One or more Boolean values can be combined into a Boolean expression using certain operators
Read now
Unlock full access