print any in python code example
Example 1: any in python
The any() function takes an iterable (list, string, dictionary etc.) in Python.
The any() function returns the boolean value:
True if at least one element of an iterable is true
False if all elements are false or if an iterable is empty
Example:
some_list = [1, 2, 3]
print(any(some_list))
another_list = []
print(any(another_list))
Example 2: any and all in python3
print (all([True, True, True, True]))
print (all([False, True, True, False]))
print (all([False, False, False]))