Python program to Generate Random Numbers Using Arrays

from random import randint
x = 20
print("Generate Rondom elements Array")
array = []
for i in range(x):
 array.append(randint(1,10))
for i in array:
 print(i,end=' ')
print()

 

 

Output:

Generate Rondom elements Array
6 4 2 7 2 10 10 10 1 5 8 10 7 7 8 9 10 7 5 5

 

Generate Rondom elements Array
1 1 4 9 6 10 1 2 3 8 2 1 1 1 8 10 1 8 8 6

Subscribe For Daily Updates