Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

generate a list of random numbers python

#To create a list of integer values that has random length with random values:
import random
#name of your list = (random.sample(range(of num the list elements has to be 
#within), 
#random.randint(range (of numbers your length of list may be))
list = (random.sample(range(1,10),random.randint(1,3)))
print(list)

#here list will have 3 elements and
#the elements will be witin 1 to 10
 
PREVIOUS NEXT
Tagged: #generate #list #random #numbers #python
ADD COMMENT
Topic
Name
8+8 =