Skip to content

Instantly share code, notes, and snippets.

@Kush1101
Created October 27, 2020 11:53
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 Kush1101/97603c6e5ca0a9981bc9af0d40f6b53a to your computer and use it in GitHub Desktop.
Save Kush1101/97603c6e5ca0a9981bc9af0d40f6b53a to your computer and use it in GitHub Desktop.
from itertools import tee
iterable = [1, 2, 4, 6, 7, 13]
for i in tee(iterable, 4):
print(list(i))
# OUTPUT
"""
[1, 2, 4, 6, 7, 13]
[1, 2, 4, 6, 7, 13]
[1, 2, 4, 6, 7, 13]
[1, 2, 4, 6, 7, 13]
"""
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment