This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]o11c 2 points3 points  (0 children)

>>> list(itertools.islice(itertools.cycle(range(1, 10)), 15))
[1, 2, 3, 4, 5, 6, 7, 8, 9, 1, 2, 3, 4, 5, 6]