Any and All Operator In Python
Any operator
This operator return True if any of the items in the list is True. It return False if empty or all the items are False.
Example #1:-
Output :-
Example #2:-
Output :-
Example #3 :- Program using any operator
Output :-
Explanation :- Its return True because in the list its find one item is True
All operator
This all operator return True if all the items of the list are True, if any one of them is False then it will return False.
Example #4:-
Output :-
Example #5 :-
Output :-
Explanation :- Its return True because all the items in the list are True.
I hope You understand the concept of the Any and All operator in python. If you have any query or suggestion please do a comment.
Thank You.
Comments
Post a Comment