Skip to content

Instantly share code, notes, and snippets.

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 adrianmarkperea/9a93403ec58a05180a46ead35df06953 to your computer and use it in GitHub Desktop.
Save adrianmarkperea/9a93403ec58a05180a46ead35df06953 to your computer and use it in GitHub Desktop.
# say you have a pair of cartesian coordinates x and y
x = 1
y = 16
# you can `pack` them into a tuple like so
point = x, y
print(point) # => (1, 16)
# and `unpack` them like so
new_x, new_y = point
print(new_x) # => 1
print(new_y) # => 16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment