-->
当前位置:首页 > 题库

PROGRAMMING:Merging two dictionaries

Luz5年前 (2021-05-10)题库453
First enter two dictionaries in two lines, then Merging two dictionaries into one.If two dictionaries have the same key, the corresponding values are added together to form a new value for that key in the dictionary. The data of the key and value of the dictionary is always numeric.
### Input Format:
### Output Format:
Output the merged dictionary in increasing order of keys.
### Sample Inputs1:
```in
{1:2,3:9,5:2,6:2}
{2:1,6:3,7:9,1:4}
```
### Sample Output1:
```out
{1: 6, 2: 1, 3: 9, 5: 2, 6: 5, 7: 9}
```







answer:If there is no answer, please comment