Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

python how to randomly choose an item from a list

import random

nums = ['a', 'b', 'c', 'd', 'e']
print(random.choice(nums))
 
PREVIOUS NEXT
Tagged: #python #randomly #choose #item #list
ADD COMMENT
Topic
Name
7+1 =