How to implement this function in Python?

I’m trying to implement the monitor function in Python.

This function must display at regular interval the date followed by the return of the “measure” function. It stops after cycles executions and the interval will never be less than 1.

The function’s execution time must be less than (cycles + 1) * interval

def monitor(interval=1.0, cycles=42):

def measure():

time.sleep(random.random())

return random.randint(123, 456)

pass

What exactly are you having trouble with? Over all the question sounds a lot like homework, and I don’t think anyone here wants to just do that for you. :wink:

@MK1993 i think @airtower-luna is right this question look like it was your homework better to find out by yourself :grin: