Skip to content

Instantly share code, notes, and snippets.

@IndhumathyChelliah
Created Jun 15, 2020
Embed
What would you like to do?
#If all items in set is True
s1={1,2,3}
print(all(s1)) #Output:True
print(any(s1)) #Output:True
#If set is empty
s2=set()
print (all(s2)) #Output:True
print(any(s2))#Output:False
#If one item in set is False
s3={1,0}
print (all(s3))#Output:False
print (any(s3))#Output:True
#If all items in set is False
s4={0,False}
print (all(s4))#Output:False
print (any(s4))#Ouput:False
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment