Python Function Reference

all

Check that all items are truthy.

Python 3.13
all(iterable)
iterable
The values to check.
Iterable

Return value

True if all items are truthy or the iterable is empty, otherwise False.

Examples

Not all values are true

Python 3.13
print(all([True, True, False]))
False

Empty list

Python 3.13
print(all([]))
True

Details

Iteration stops at the first falsy item. For an empty iterable the result is True because it has no falsy items.

See also