Skip to content

Instantly share code, notes, and snippets.

@dhollman
Created October 4, 2013 13:58
Show Gist options
  • Save dhollman/6826335 to your computer and use it in GitHub Desktop.
Save dhollman/6826335 to your computer and use it in GitHub Desktop.
from itertools import tee
a, b = "abc", "1234"
ai, bi = iter(a), iter(b)
for i in ai:
bi, bnew = tee(bi)
for j in bnew:
print i, j
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment