Skip to content

Instantly share code, notes, and snippets.

@IndhumathyChelliah
Created June 15, 2020 06:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save IndhumathyChelliah/5ff5583b11a74c7ad193440ce2fd8a7a to your computer and use it in GitHub Desktop.
Save IndhumathyChelliah/5ff5583b11a74c7ad193440ce2fd8a7a to your computer and use it in GitHub Desktop.
#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