×

Welcome to TagMyCode

Please login or create account to add a snippet.
0
0
 
0
Language: Python
Posted by: Matthew J_
Added: Jun 22, 2022 1:26 PM
Modified: Jun 22, 2022 1:27 PM
Views: 0
Tags: no tags
  1. #Any or All
  2.  
  3. l1 = ['sanjose', 'cupertino', 'sunnyvale', 'fremont']
  4. ifalltrue = all(l1)
  5. print(ifalltrue)        # Returns True
  6.  
  7. l2= [0,0,0,False]
  8. ifanytrue = any(l2)
  9. print(ifanytrue)        # Returns False