Situatie
“all” returns true if all of the items are True or if the iterable is empty. It returns False if any of the items is false.
Solutie
Pasi de urmat
# Here all the iterables are True so all
# will return True and the same will be printed
print (all([True, True, True, True]))
# Here the method will short-circuit at the
# first item (False) and will return False.
print (all([False, True, True, False]))
# This statement will return False, as no
# True is found in the iterables
print (all([False, False, False])
Output :
True
False
False
Leave A Comment?