SQLDAXExcelPython
Leaderboard
Core PythonMedium20 points

Merge two dictionaries by adding

Complete merge_totals(a, b) so it returns one dictionary holding every key, with values added where a key is in both.

How your answer is tested

After your code, this runs and its result is checked:

result = merge_totals({"North": 5, "South": 2, "East": 0}, {"South": 3, "West": 7})
Show solutionLifetime

Real Python running in your browser through Pyodide, with pandas available. Nothing you type is sent to a server unless you save a score.

Python
Loading editor…

Press Ctrl+Enter or Run to see the result here.