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?
update each key in my_dict:
my_dict
my_dict.update({n: 2 * my_dict[n] for n in my_dict.keys()})