Welcome to collectivesolver - Programming & Software Q&A. A website you can trust. All programs tested and works. Contact: aviboots(AT)netvision.net.il
Hostgator 1 Penny

BlueHost Web Hosting

Ecommerce Software - Best Ecommerce Platform Made for You - Free Trial

Ecommerce Software - Best Ecommerce Platform Made for You - Free Trial

getflywheel wordpress hosting


Distribute your Resume to 500+ Job Boards & Recruiters


7,621 questions

10,674 answers

573 users

How to fill a list (array) with random numbers in Python

1 Answer

0 votes
import random

the_numbers = [0] * 15
size = len(the_numbers)

for i in range(size):
    the_numbers[i] = random.randint(1, 500)

print(the_numbers)

'''
run:

[148, 97, 189, 302, 374, 54, 16, 460, 157, 33, 377, 69, 274, 463, 220]

'''

 




answered May 13 by avibootz
...