Skip to content

Instantly share code, notes, and snippets.

@slingam00
Last active May 22, 2020 04:41
Show Gist options
  • Save slingam00/7054910034ed5d5f39ccc1ba9507c98f to your computer and use it in GitHub Desktop.
Save slingam00/7054910034ed5d5f39ccc1ba9507c98f to your computer and use it in GitHub Desktop.
mySet = {'a', 'b', 'c'}
# Adding to the set
mySet.add('d')
print(mySet) # Sets are unordered so the resulting Set varies
# An example of a result would be {'a', 'd', 'b', 'c'}
# Removing from the set
mySet.remove('c')
# Updating the set
mySet.update(['e', 'f', 'g']) # Result could look something like: {'a', 'e', 'b', 'f', 'g'}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment