I\'m a bit at a loss as to how to find a clean algorithm for doing the following:
Suppose I have a dict k:
>>> k = {\'A\': 68, \'B\': 62, \'
The algorithm would be this..
Select a number randomly between 1 and 274. To do that, call a rand() funciton (assume it returns a value between 0 and 1), multiply rand() by 274. The resulting value should now be in a range. If its between 1 and 68, select A, if its between 69 and 130 select B and so on. This way, your probability stays alive and your operation succeeds.
PS: I am a Java guy, dont know the syntax of Python.