Created
October 5, 2019 03:51
-
-
Save adrianmarkperea/9a93403ec58a05180a46ead35df06953 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
# 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