Untitled

 avatar
unknown
plain_text
a year ago
404 B
6
Indexable
def range_generator(end, start=0, step=1):
    if(step < 0 and start < end):
        print("Achtung: Endlosschleife!")
    else:
        while(start < end):
            yield start
            start = start + step

    if(step > 0 and start > end):
        print("Achtung: Endlosschleife!")
    else:            
      while(start > end):
          yield start
          start = start + step
Editor is loading...
Leave a Comment