You can download this code by clicking the button below.
This code is now available for download.
This function generates a random number within a specified range, defined by min_value and max_value, with a specified step.
Technology Stack : random
Code Type : Function
Code Difficulty : Intermediate
import random
def generate_random_number(min_value, max_value, step):
"""
Generate a random number between min_value and max_value with a specified step.
"""
return random.randrange(min_value, max_value + 1, step)