Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

Select an element of a list by random

import random 

rand_index = random.randrange(len(list)) 
random_num = list[rand_index] 

random_num = random.choice(list)
 
PREVIOUS NEXT
Tagged: #Select #element #list #random
ADD COMMENT
Topic
Name
2+5 =