Answers for "random with probability python function"

0

random with probability python

import random

data = [1, 2, 3, 4, 5, 6]
probability = [0.3, 0.3, 0.1, 0.1, 0.1, 0.1]
 
random.choices(data, probability)
Posted by: Guest on May-04-2021

Code answers related to "random with probability python function"

Python Answers by Framework

Browse Popular Code Answers by Language