I have a dictionary associating a probability to a char
d = {'a': 0.2, 'b': 0.3, 'c': 0.4, 'd':0.1}
And I am searching a way to associate to each char the lowest value of his frequency distribution. So every char must be associated to the sum of the previous ones. I know dictionary are not ordered but it should return something like
ddist = {'a': 0, 'b': 0.2, 'c': 0.5, 'd': 0.9}
I tried with a loop but I did not find a way to get the previous values...
Any ideas ?