Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

random element python

import random

list = ("Carrots","Peanuts","Apples","Peaches")

random.choice(list)
# return a random element from the list
random.choice(list,2)
# return 2 random elements from the list
 
PREVIOUS NEXT
Tagged: #random #element #python
ADD COMMENT
Topic
Name
4+4 =