Python bool() Function
Definition and Usage
The bool() function returns the boolean value of the specified object.
This object will always return True unless:
- The object is empty, such as [], (), {}
- The object is False
- The object is 0
- The object is None
Syntax
bool(object)
Parameter Value
Parameter | Description |
---|---|
object | Any object, such as strings, lists, numbers, and so on. |