Programming Exercises

Merge two dictionaries.

Medium

Problem Statement

Merge two dictionaries.

Sample Input

{'a': 1, 'b': 2}, {'b': 3, 'c': 4}

Sample Output

{'a': 1, 'b': 3, 'c': 4}

Limits

Time: 2s · Memory: 256 MB

Code Editor
00:00
def merge_dictionaries(): dict1 = {'a': 1, 'b': 2} dict2 = {'b': 3, 'c': 4} # Your code here return
Log in or sign up to run or submit your code.Log inSign up
Input
{'a': 1, 'b': 2}, {'b': 3, 'c': 4}
Expected Output
{'a': 1, 'b': 3, 'c': 4}