I have a list of approx. 10000 items. The current situation is that every item has an associated weight (priority or importance). Now the smallest weight is -100
-100
Python 3.6 introduced random.choices()
def get_item(items, items_weights): return random.choices(items, weights=items_weights)[0]