demo_ref_random_choices.py:
import random mylist = ["apple", "banana", "cherry"] print(random.choices(mylist, weights = [10, 1, 1], k = 14))
➜ begtut>python demo_random_choices.py