Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

any() and all()

# any() or all() function, checking if any or all elements are True
l1 = ['sanjose', 'cupelation', 'sunnyvale', 'fremont']
print(all(l1))
#Returns True

l2= [0,0,0,False]
print(any(l2))
#Returns False
 
PREVIOUS NEXT
Tagged:
ADD COMMENT
Topic
Name
5+5 =