Skip to content

Instantly share code, notes, and snippets.

@alphazwest
Created December 30, 2020 22:33
Show Gist options
  • Save alphazwest/856651a8cd217ddc1720f86c645e230d to your computer and use it in GitHub Desktop.
Save alphazwest/856651a8cd217ddc1720f86c645e230d to your computer and use it in GitHub Desktop.
# Create a new set object
set_one = {1, 2, 3}
>>> {1, 2, 3}
# Update with tuple value
set_one.update((4, 5, 6, 6))
>>> {1, 2, 3, 4, 5, 6}
# Update with iterable containing tuple
set_one.update(((7, 8, 9, 9), ))
>>> {1, 2, 3, 4, 5, 6, (7, 8, 9, 9)}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment