Generate weighted random numbers


Topic: Generate weighted random numbers

Solution

import random
randomList = random.choices(range(10, 40, 5), cum_weights=(5, 15, 10, 25, 40, 65), k=6)
print(randomList)



List all Python Programs