I use .Choices to select a value randomly whith weight value.
Is it possible to store the used weight value to a variable?
var = random.choices(population=A, B, C, weights=[20, 20, 60])
Thanks!
>Solution :
Just store it before you give it to the function. You must also change the way you assign the population. Your Code sould look more like this:
my_weights = [20, 20, 60]
my_population = ["A", "B", "C"]
var = random.choices(population = my_population, weights = my_weights)
Like this the code should ork an you could access the weights and population afterwards in my_weights and my_population.