def randomPickDict(d):
    ''' given a diictionary d, with all values are numbers,
        randomly pick an item and return it's key according
        to the percentage of its values'''
    ks = d.keys()
    vs = accumList(d.values(),1)
    return ks[ findIndex( vs, random.random()) ]
 given a diictionary d, with all values are numbers,
        randomly pick an item and return it's key according
        to the percentage of its values
recipes/Python/278259_Dictionary_Tools/recipe-278259.py