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)
Source by pynative.com #
 
PREVIOUS NEXT
Tagged: #Select #element #list #random
ADD COMMENT
Topic
Name
9+3 =