Python/Tutorial/Basic Types and Operators/bool
< Python | Tutorial | Basic Types and Operators(Redirected from Python/Tutorial/Basic Types/bool)
The bool type represents boolean values---True and False.
Using the bool() function, you can convert almost anything into a bool. The rules are:
- None, 0 and 0.0 is False.
- Empty lists, sets, and dicts are False.
- Special kinds of objects may be True or False, if they make the distinction.
- Everything else is True.