Skip to content

Instantly share code, notes, and snippets.

Created Jul 5, 2020
What would you like to do?
import itertools
#itertools.repeat() used in zip()
#It will return zip object which is an iterable instance of zip class
print (l2)#Output:<zip object at 0x032794E8>
#we can convert zip object to list.
print (list(l2))#Output:[(2, 5), (2, 15), (2, 25)]
# We can access zip object by using for loop.This is more efficient way to access large sequences.It won't be memory intensive.
for i in l3:
print (i)
('hello', 5)
('hello', 15)
('hello', 25)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment