Skip to content

Instantly share code, notes, and snippets.

@IndhumathyChelliah
Created June 15, 2020 03:21
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/59ee73d2b389efd6ad9027b8b65b9e6c to your computer and use it in GitHub Desktop.
Save IndhumathyChelliah/59ee73d2b389efd6ad9027b8b65b9e6c to your computer and use it in GitHub Desktop.
s1={1,2,3}
#add single item to set
s1.add(4)
print (s1)#Output:{1, 2, 3, 4}
#add multiple item to set
s1.update({3,4,5})
print (s1)#Output:{1, 2, 3, 4, 5}
s1.update([5,6])
print (s1)#Output:{1, 2, 3, 4, 5, 6}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment