Horje
random with probability python Code Example
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)




Python

Related
python previous answer Code Example python previous answer Code Example
how to fill a list in python Code Example how to fill a list in python Code Example
shutil move overwrite Code Example shutil move overwrite Code Example
how to change values of dictionary in python Code Example how to change values of dictionary in python Code Example
apostrophe in python Code Example apostrophe in python Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
13