Created
May 13, 2014 19:38
-
-
Save dutc/aa122c9976d5fd8890da to your computer and use it in GitHub Desktop.
itertools question
This file contains hidden or 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
from itertools import cycle, chain | |
xs = [1,2,3] | |
ys = [4,5,6] | |
for x,y in chain(zip(cycle([2]), xs), zip(cycle([9]), ys)): | |
print(x+y) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment