In python 2.6 I want to perform an operation on each dictionary value, for example, I want to multiply by 2 for each of them. How to code less for this task?
# A nice one liner (edited to remove square brackets) my_dict.update((x, y*2) for x, y in my_dict.items())