from xlib.util import random_util data = ['A', 'B', 'C', 'D'] print random_util.weight_choice(data, [10, 2, 2, 1])
Last updated 1 year ago