The Python Book
 
shorties quickies
20151014

Shorties & quickies

Get an array of 10 random numbers

randrange: choose a random item from range(start, stop[)

import random
rand_arr=[ random.randrange(0,10) for i in range(10) ]
 
Notes by Willem Moors. Generated on momo:/home/willem/sync/20151223_datamungingninja/pythonbook at 2019-07-31 19:22