Skip to content

Instantly share code, notes, and snippets.

@IndhumathyChelliah
Last active July 6, 2020 05:56
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/a3917388103d8f52bc09aa324ef2f173 to your computer and use it in GitHub Desktop.
Save IndhumathyChelliah/a3917388103d8f52bc09aa324ef2f173 to your computer and use it in GitHub Desktop.
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