Home >>Python Built-in Functions >Python any() Function
Python any() function is used to return True if any of the item present in an iterable are true otherwise it will return False. If the iterable object is empty then also it will return False.
Syntax:
any(iterable)
Parameter | Description |
---|---|
iterable | This parameter contains an iterable object. |
Here is an example of Python any() function:
listx = [False, True, False] x = any(listx) print(x)
Example 2:
tuplex = (0, 1, False) x = any(tuplex) print(x)