Python any() method is a built-in method. It is used to check that any element in iterable (list, tuple, set) is True. It returns True, if any element in the iterable is True. It returns False when all the elements are False or the iterable is empty.
Parameter | Description |
---|---|
iterable | (Required) This argument can be a list, tuple, dictionary etc. |
It returns either True or False based on the elements present in the iterable.
Let’s first understand, how this method works and what does it return?