Untitled

mail@pastecode.io avatar
unknown
plain_text
2 months ago
404 B
1
Indexable
Never
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
Leave a Comment