Python Program to generate a random number within the given range

Program

# Program to generate a random number between two given numbers
import random
#Syntax: random.randint(a,b)
start = int(input("Enter the start number of the range: "))
end = int(input("Enter the start number of the range: "))
print(random.randint(start,end))

Output

$ python3 GenerateRandomNumbers.py 
Enter the start number of the range: 25
Enter the start number of the range: 50
38

Tags: