How to use any() in Python

any() returns True if at least one item in a sequence of values is True, otherwise it returns False.

Solution for How to use any() in Python : You can use any() on an iterable object Call any(iterable) on any iterable object such as a list, tuple, set, or dictionary to check for the existence of a True value. When used on a dictionary, only keys are considered and not the values. You can also use generator expressions such as x > 0 for x in lst as an iterable .