Random Number Generation within Range

  • Share this:

Code introduction


This function generates a random integer within a specified range.


Technology Stack : math, random

Code Type : Mathematical Calculations and Random Number Generation

Code Difficulty : Intermediate


                
                    
import math
import random

def generate_random_number(min_value, max_value):
    return random.randint(min_value, max_value)                
              
Tags: