ID EN
Built-in Functions

any

Python 3.11

Return True if any element of the iterable is true. If the iterable is empty, return False. Equivalent to:

Syntax

PYTHON
any(iterable)

Examples

Example 1
PYTHON
def any(iterable):
    for element in iterable:
        if element:
            return True
    return False