Chapters
Python114 chapters

ReferenceBuilt-in functions

any()

True when at least one item is truthy, and False for an empty iterable.

Signature

any(iterable)

Parameters

NameMeans
iterableany sequence or generator

Returns

A bool. It stops at the first truthy item.

Example

Python
print(any([False, True]))
print(any([False, False]))
print(any([]))

Output

True
False
False

See also