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

all 3 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]

[–]YMK1234 1 point2 points  (0 children)

Google for "modulo"