This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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