Skip to content

Instantly share code, notes, and snippets.

@wwgist
Created March 7, 2013 11:18
Show Gist options
  • Save wwgist/5107382 to your computer and use it in GitHub Desktop.
Save wwgist/5107382 to your computer and use it in GitHub Desktop.
PYTHON: zipping lists to one list of tuples
letters = ['a', 'b', 'c']
numbers = [1, 2, 3]
squares = [1, 4, 9]
zipped_list = zip(letters, numbers, squares)
# zipped_list = [('a', 1, 1), ('b', 2, 4), ('c', 3, 9)]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment