You can download this code by clicking the button below.
This code is now available for download.
This function generates a random integer between the specified minimum and maximum values.
Technology Stack : random
Code Type : Generate random numbers
Code Difficulty :
import random
def generate_random_number(min_val, max_val):
"""
Generate a random number between min_val and max_val.
"""
return random.randint(min_val, max_val)