First page Back Continue Last page Overview Graphics

Exercise

Write a generator "trange", which generates a sequence of time tuples from start to stop incremented by step.

A time tuple is a 3-tuple of integers: (hours, minutes, seconds)

Example:

for time in trange((10, 10, 10), (13, 50, 15), (0, 15, 12) ):

print(time)

will return

(10, 10, 10)

(10, 25, 22)

(10, 40, 34)

(10, 55, 46)

(11, 10, 58)

(11, 26, 10)

...