def new_range(start, stop, step = 1):
while start < stop:
yield start
start += step
for i in new_range(1, 20, 4):
print(i)
D:\Python\Python36\python.exe D:/Python_test/day_lesson/test.py
1
5
9
13
17
Process finished with exit code 0