import random
number=list(range(1,10))
weighted=[1]*2+[2]*2+[3]*2+[4]*2+[5]*2
number_weighted=random.choice(number,weighted,k=1) **#if k=4 then the same number is chosen sometimes**
I want to use loop 3 times to choose the each one number.
I want to choose the number that independent(not same), weighted.
In python, if you know this problem, I would appreciate it if you taught me
For example, number=[1,2,3,4,5] weighted=[0.1,0.1,0.4,0.3,0.1] then choose two number i want 3, 4 Probability) but random.choice function is sometimes 1,1 selected.
so, i think i take one number (suppose number 3) then number=[1,2,4,5] weighted=[0.1,0.1,0.3,0.1] and i take one number (suppose number 4). use loop function