Skip to content

Instantly share code, notes, and snippets.

@eyaltrabelsi
Created June 21, 2019 07:07
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 eyaltrabelsi/455470579908c06d2b8712741a7ee00f to your computer and use it in GitHub Desktop.
Save eyaltrabelsi/455470579908c06d2b8712741a7ee00f to your computer and use it in GitHub Desktop.
Python-tricks swapping variables with unpacking
>>> 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