Untitled

mail@pastecode.io avatar
unknown
plain_text
2 months ago
369 B
2
Indexable
Never
def range_generator(end, start=0, step=1):
    while(start < end):
        yield start
        start = start + step
    while(start > end):
        yield start
        start = start + step

for i in range_generator(10, start=1, step=3):
    print(i)

for i in range_generator(5):
    print(i)

for i in range_generator(0, start=10, step=-4):
    print(i)
Leave a Comment