fork download
  1. n_dict = {4: [4,1,6], 3: [5,3,9], 2: [8,2,10]}
  2. n_sum = {n_key: sum(n_dict[n_key]) for n_key in n_dict.keys()}
  3. print(n_sum)# your code goes here
Success #stdin #stdout 0.02s 9132KB
stdin
Standard input is empty
stdout
{4: 11, 3: 17, 2: 20}