Normally I would use sum(dict['A'].values()) in order to sum all the values in a dictionary with the key "A". However in this case it is not all the values of the "main" key I want to sum, but rather all the values where the "secondary/sub-key" has a specific name. Let me show a simplified example below:

```
dict = {'A':{'val1':3,'val2':5},'B':{'val1':2,'val2':6}}
sum1 = dict['A']['val1']+dict['B']['val1']
sum2 = dict['A']['val2']+dict['B']['val2']

```

The example above is fairly easy since it's only a 2\*2 dimension, and thus I can fairly easily add the values directly. But this method is not practical when the dictionary gets larger. So I wonder what is the most efficient solution.