any returns True if any of the values in its input iterable are True.
all returns True if and only if all of the values in its input iterable are True.
print(any(True, False, True)) # -> True
print(all(True, False, True)) # -> FalseThese functions can be thought of as a reduction:
import functools as ft
any = lambda xs: ft.reduce(lambda p, q: p or q, xs, False)
all = lambda xs: ft.reduce(lambda p, q: p and q, xs, True)