n_dict = {4: [4,1,6], 3: [5,3,9], 2: [8,2,10]}n_sum = {n_key: sum(n_dict[n_key]) for n_key in n_dict.keys()}print(n_sum)# your code goes here
Standard input is empty
{4: 11, 3: 17, 2: 20}
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!