You can download this code by clicking the button below.
This code is now available for download.
This function uses the randint method from the random module to generate a random integer within a specified range.
Technology Stack : random
Code Type : Function
Code Difficulty : Intermediate
import random
def generate_random_number(min_value, max_value):
"""
Generate a random integer between min_value and max_value.
Args:
min_value (int): The minimum value of the random number.
max_value (int): The maximum value of the random number.
Returns:
int: A random integer between min_value and max_value.
"""
return random.randint(min_value, max_value)