The any() function returns True if any item in an iterable are true. If no item is true then False.
Syntax & Parameters
any(iterable)
iterable – An iterable object list, tuple, dictionary etc.
Ex.
# 1 is True , 0 is False
mList = [1, 1, 0]
print(any(mList))
# The any() function checks the keys, not the values in dictionaries.
mDict = {0 : "Car", 1 : "Truck"}
print(any(mDict))
# True
mStr = "this is a string"
print(any(mStr))
Output :
True
True
True