In the function below, use a function from the random module to return a random integer between the given lower_bound and upper_bound, inclusive. Don't forget to import the random module (before the function declaration).
For example, return_random_int(3, 8) should random return a number from the set: 3, 4, 5, 6, 7, 8.
length.py
def return_random_int(lower_bound, upper_bound):

Respuesta :

Answer:

import random

def return_random_int(lower_bound, upper_bound):

   return random.randrange(lower_bound, upper_bound)

   

print(return_random_int(3, 8))

Explanation:

Import the random module

Create a function called return_random_int takes two parameters, lower_bound and upper_bound

Return a number between lower_bound and upper_bound using random.range()

Call the function with given inputs, and print the result

ACCESS MORE