Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

python random select no replace

import random

aList = [20, 40, 80, 100, 120]
print ("choosing 3 random items from a list using random.sample() function")
sampled_list = random.sample(aList, 3)
print(sampled_list)
Source by pynative.com #
 
PREVIOUS NEXT
Tagged: #python #random #select #replace
ADD COMMENT
Topic
Name
1+5 =