1The any() function takes an iterable (list, string, dictionary etc.) in Python.
2
3The any() function returns the boolean value:
4
5True if at least one element of an iterable is true
6False if all elements are false or if an iterable is empty
7
8Example:
9some_list = [1, 2, 3]
10print(any(some_list)) # True
11another_list = []
12print(any(another_list)) # False
1# True since 1,3 and 4 (at least one) is true
2l = [1, 3, 4, 0]
3print(any(l))
4
5# False since both are False
6l = [0, False]
7print(any(l))
8
9# True since 5 is true
10l = [0, False, 5]
11print(any(l))