Перейти к содержанию

Python any() built-in function

Python any() built-in function

From the Python 3 documentation Return True if any element of the iterable is true. If the iterable is empty, return False.

Examples

>>> any([False, False, False])
# False

>>> any((0, True, False))
# True

>>> any({0, 0, 0})
# False