Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

select a value randomly in a set python

import random

# with replacement = same item CAN be chosen more than once.
# without replacement = same item CANNOT be chosen more then once.

# Randomly select 2 elements from set without replacement and return a list
random.sample(set_name, 2)
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #select #randomly #set #python
ADD COMMENT
Topic
Name
3+1 =