Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

python random distribution

#random distributer of elements in List
import random

List = [9,9,9,9,8,8,7,7,6,6,6,"G"] #my grades 
len_ = len(List)
Rand_List = []

for l in range(len_):
    rand_ = random.randint(0,len(List)-1)
    Rand_List.append(List[rand_])
    del List[rand_]

print(Rand_List)#if my grades are displaced in random order
 
PREVIOUS NEXT
Tagged: #python #random #distribution
ADD COMMENT
Topic
Name
5+1 =