Situatie
“any” returns true if any of the items is True. It returns False if empty or all are false.
Solutie
Pasi de urmat
# Since all are false, false is returned
print (any([False, False, False, False]))
# Here the method will short-circuit at the
# second item (True) and will return True.
print (any([False, True, False, False]))
# Here the method will short-circuit at the
# first (True) and will return True.
print (any([True, False, False, False]))
Output :
False
True
True
Leave A Comment?