from random import random
P = [0.1, 0.25, 0.6, 0.05]
cdf = [P[0]]
for i in range(1, len(P)):
    cdf.append(cdf[-1] + P[i])
random_ind = bisect(cdf, random())
Choose list variable given probability of each variable