Home >>Python Built-in Functions >Python bool() Function
Python bool() function is used to convert the value of a given input object to boolean. The given object will always return True unless it is empty, false, zero, or none.
Syntax:bool(object)
Parameter | Description |
---|---|
object | This parameter defines any object, like String, List, Number etc. |
x = bool(1) print(x)
x = 5 y = 10 print(bool(x==y))