Skip to content

Instantly share code, notes, and snippets.

@vinaykudari
Last active July 21, 2018 21:50
Show Gist options
  • Save vinaykudari/52158d0b35d75894fa11359df14dccc2 to your computer and use it in GitHub Desktop.
Save vinaykudari/52158d0b35d75894fa11359df14dccc2 to your computer and use it in GitHub Desktop.
zip function
list_a = [1, 2, 3, 4, 5]
list_b = ['a', 'b', 'c', 'd', 'e']
zipped_object = zip(list_a, list_b)
>> type(zipped_object)
<class 'zip'>
>> list(zipped_object)
[(1, 'a'), (2, 'b'), (3, 'c'), (4, 'd'), (5, 'e')]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment