Skip to content

Instantly share code, notes, and snippets.

@smerritt
Last active August 29, 2015 14:06
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 smerritt/bc0e242ed0b3fd424979 to your computer and use it in GitHub Desktop.
Save smerritt/bc0e242ed0b3fd424979 to your computer and use it in GitHub Desktop.
zip() is self-inverse
>>> thing = [(1, 2, 3), ('a', 'b', 'c')]
>>> zip(*thing)
[(1, 'a'), (2, 'b'), (3, 'c')]
>>> zip(*zip(*thing))
[(1, 2, 3), ('a', 'b', 'c')]
>>>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment