#itertools.count()- creates an iterator which yields infinite sequence of integers from a starting point from itertools import count seq = count(0, 2) #an infinite sequence of even numbers print(next(seq)) print(next(seq)) print(next(seq)) print(next(seq)) print(next(seq))