logo CodeStepByStep logo

random_over

Language/Type: Python parameters loops random

Write a function named random_over that accepts two integer parameters n and max and repeatedly prints random numbers between 0 and max (inclusive) until a number greater than or equal to n is printed. At least one line of output should always be printed, even if the first random number is above n. Here is a sample log from the call of random_over(900, 1000)

Random number: 235
Random number: 15
Random number: 810
Random number: 147
Random number: 915
Function: Write a Python function as described, not a complete program.

You must log in before you can solve this problem.

Log In

Need help?

Stuck on an exercise? Contact your TA or instructor.

If something seems wrong with our site, please

Is there a problem? Contact us.