📜  python3中的任何和所有 - Python代码示例

📅  最后修改于: 2022-03-11 14:45:28.675000             🧑  作者: Mango

代码示例1
# 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]))