Given a dictionary, I need to calculate the sum of the logarithms of the values contained in the dictionary, until that sum is greater than 1.
I've started by calculating the partial sums:
r = [itertools.accumulate(math.log(items.values(),2))]
But I'm stuck on how to terminate the operation when the sum gets greater than 1.