-
-
Save IndhumathyChelliah/59ee73d2b389efd6ad9027b8b65b9e6c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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