Any and All are two built ins provided in python used for successive And/Or.
Learn Python - Python tutorial - python any operator - Python examples - Python programs
Any
- Returns true if any of the items is True. It returns False if empty or all are false. Any can be thought of as a sequence of OR operations on the provided iterables.
- It short circuit the execution i.e. stop the execution as soon as the result is known.
Syntax : any(list of iterables)
python tutorial - Output :
Returns true if all of the items are True (or if the iterable is empty). All can be thought of as a sequence of AND operations on the provided iterables. It also short circuit the execution i.e. stop the execution as soon as the result is known.
Syntax : all(list of iterables)
python tutorial - Output :