0
Q:

random.choices

import random
l=[1,2,3,4,5,6,7,8,9,0]
random.choice(l)
print(l);
2

    import random

    
mylist = ["apple", "banana", "cherry"]

print(random.choices(mylist, 
    weights = [10, 1, 1], k = 14)) 
0

New to Communities?

Join the community