Python program to Fill a List with Random Numbers

from random import randint
mini = int(input("Insert minimum number: "))
maxi = int(input("Insert maximum number: "))
y = int(input("Insert range of random numbers: "))
x = [randint(mini,maxi) for i in range(y)]
print(x)

 

 

 

Output:

Insert minimum number: 2
Insert maximum number: 29
Insert range of random numbers: 3
[9, 5, 22]

 

Insert minimum number: 9
Insert maximum number: 99
Insert range of random numbers: 11
[71, 37, 47, 84, 41, 45, 49, 42, 28, 79, 13]

 

Subscribe For Daily Updates