Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
# 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
You can’t perform that action at this time.