Skip to content

Instantly share code, notes, and snippets.

@IndhumathyChelliah
Last active Jul 6, 2020
Embed
What would you like to do?
import itertools
l1=[1,2,3,4,5]
l2=itertools.tee(l1,3)
print (l2)#Output:(<itertools._tee object at 0x028794C8>, <itertools._tee object at 0x028792C8>, <itertools._tee object at 0x02879528>)
for i in l2:
print (list(i))
'''
Output:
[1, 2, 3, 4, 5]
[1, 2, 3, 4, 5]
[1, 2, 3, 4, 5]
'''
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment