Skip to content

Instantly share code, notes, and snippets.

@IndhumathyChelliah
Created July 23, 2020 03:41
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 IndhumathyChelliah/94a51b6141d7a1edab7435540eaf8844 to your computer and use it in GitHub Desktop.
Save IndhumathyChelliah/94a51b6141d7a1edab7435540eaf8844 to your computer and use it in GitHub Desktop.
l1=[1,2,3]
l2=['a','b','c'
#zip() returns an iterator
z=zip(l1,l2)
print (z)#Output:<zip object at 0x02DB94E8>
#Accessing elements in the iterator using next() function.
print (next(z))#Output:(1, 'a')
print (next(z))#Output:(2, 'b')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment