Skip to content

Instantly share code, notes, and snippets.

@mh0w
Created October 21, 2022 15:25
Show Gist options
  • Save mh0w/77e8e596bf4d36b56ade29efa45bcb28 to your computer and use it in GitHub Desktop.
Save mh0w/77e8e596bf4d36b56ade29efa45bcb28 to your computer and use it in GitHub Desktop.
convert list of tuples to two lists
z = zip(*[(1, 2), (3, 4), (5, 6)])
l1, l2 = map(list, z)
print(l1) #[1, 3, 5]
print(l2) #[2, 4, 6]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment