Skip to content

Instantly share code, notes, and snippets.

@colbymorrison
Created November 20, 2018 19:37
Show Gist options
  • Save colbymorrison/06d232006c858be02f0d03d0b75fb035 to your computer and use it in GitHub Desktop.
Save colbymorrison/06d232006c858be02f0d03d0b75fb035 to your computer and use it in GitHub Desktop.
mylists = ([1, 2, 3], [4, 5, 6], [7, 8, 9])
out = [sum(x) for x in zip(*mylists)]
print(out) # Prints [12, 15, 18]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment