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.


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

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

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

Subscribe to

Join 10.900+ Python developers in a two times a month and bullshit free publication , full of interesting, relevant links.