It’s not mandatory to pass the value to bool(). If you do not pass a value, bool() returns False. Python bool() function returns the boolean value of a specified object.

Python bool()

Python bool() is an inbuilt function that converts the value to Boolean (True or False) using the standard truth testing procedure.

The boolean builtins are capitalized: True and 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

#python #python bool

Python bool: How to Test Boolean Values in Python
4.75 GEEK