ScanSkill

any

This any() function returns a Boolean value that indicates whether the collection contains any values that evaluate to True.

Syntax

any(iterable)

Here,

  • collection: Required. Any iterable type(list, tuple, dictionary, etc.)

Note: If the iterable is empty, any() returns False.

Examples

>>>> any([True, True])
True
>>> any([True, False])
True
>>> any([False, False])
False
>>> any('False')
True
>>> any([])
False