bool()
Convert a value to True or False.
bool(value=False)
bool() tests whether a value counts as true. Empty collections, zero, and an empty string are false; many other values are true.
Parameters
- value
- The value to test. If omitted, it defaults to false.
Returns
True or False.Try it
Run it and change it
items = []
print(bool(items)) Output
Press Run to see what it prints.