Weighted sampling of items in Python

Let’s say you need to produce realistically distributed random selections from a list. For example, let’s say you’re writing a US meteor simulation game, and want to select the state the meteor will land in. Assuming that the impact site will be completely geographically random, then the following example will select a state, with a [...]