Created
June 21, 2019 07:07
-
-
Save eyaltrabelsi/455470579908c06d2b8712741a7ee00f to your computer and use it in GitHub Desktop.
Python-tricks swapping variables with unpacking
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
>>> a, b = 1, 2 | |
>>> a, b = b, a | |
>>> a, b | |
(2, 1) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment