The bool() function returns the boolean value of a specified object. Boolean value is either 'True' or 'False'.
bool(object)
object: Any object, like String, List, Number etc.
Returns 'True' or 'False'
The object will always return True, unless:
The object is empty, like [], (), {}
The object is False
The object is 0
The object is None
code.py output:
val = True
val = False
val = True
val = False
val = False
val = False