def counter(low, high, step): current = low while current <= high: yield current current += stepfor c in counter(3, 9, 2): print(c)# printed 3, 5, 7, 9