Python Join/Merge Dict

July 3, 2019

Data

dict1 = {'a': 1, 'b': 2}
dict2 = {'c': 3}

Python 3.x

new_dict = {**dict1, **dict2}

Python 2.x

new_dict = dict1.copy()
new_dict.update(dict2)
This work is licensed under a
Creative Commons Attribution-NonCommercial 4.0 International License.