First page Back Continue Last page Overview Image

Lösung, Teil 1

def rtrange(start, stop, step):

"""

trange(stop) -> time as a 3-tuple (hours, minutes, seconds)

trange(start, stop[, step]) -> time tuple

start: time tuple (hours, minutes, seconds)

stop: time tuple

step: time tuple

returns a sequence of time tuples from start to stop

incremented by step

The generator can be rest by sending a new "start" value.

"""

current = list(start)

while current < list(stop):

new_start = yield tuple(current)

if new_start != None:

current = list(new_start)

continue