a = [0, 0, 0, 0]
b = [0, 0, 0, 1]
c = [1, 1, 1, 1]
>>> any(a)
False
>>> any(b)
True
>>> any(c)
True
Return True if bool(x) is True for any x in the iterable.If the iterable is empty, return False.
当传入空可迭代对象时返回False,当可迭代对象中有任意一个为true,则返回True
>>> all(a)
False
>>> all(b)
False
>>> all(c)
True
Return True if bool(x) is True for all values x in the iterable.If the iterable is empty, return True.
当传入空可迭代对象时返回True,当可迭代对象中有任意一个不为True,则返回False