Python program to How to Fill List

from random import randint
def list_fill(first, qyt, mini, maxi):
 for i in range(qyt):
    first.append(randint(mini,maxi))
minimum = int(input("Insert minimum value: "))
maximum = int(input("Insert maximum value: "))
num = int(input("Number of elements: "))
x = []
list_fill(x,num,minimum,maximum)
print(x)

 

 

 

Output:

Insert minimum value: 24
Insert maximum value: 45
Number of elements: 12
[27, 26, 40, 42, 29, 37, 41, 34, 32, 26, 31, 36]

 

 

Subscribe For Daily Updates