all

Return False at the first falsy item, otherwise True, including for an empty iterable. Uses normal iteration and truth testing; supports pause and stop.

Syntax

all(iterable, /)

Parameters

NameDescription
iterableIterable
Collection or iterable to inspect.
Required · Positional only
No default

Returns

Boolean

Example

# Check that every score passes
scores = [0.9, 0.95]
print(all(score >= 0.85 for score in scores))