Python Everyday 53: Random Pick with Weight


How to randomly pick an item based on its weight, here is a sample: