Python any() Function

The any() function in Python returns a boolean value ‘True’ if any element of the iterable is true or if the iterable is empty, else it returns False.

Syntax

Parameter

Iterable: An iterable object (list, tuple, dictionary)

Return

This function returns a Boolean value True if any element of the iterable is true or if the iterable is empty, else it returns False.

Example 1

Output

Pin It on Pinterest

Share This