Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

how to merge two dictionaries

>>> dict_a = {'a': 1, 'b': 2}
>>> dict_b = {'b': 3, 'c': 4}
>>> dict_c = {**dict_a, **dict_b}
>>> dict_c
# {'a': 1, 'b': 3, 'c': 4}
Source by www.pythoncheatsheet.org #
 
PREVIOUS NEXT
Tagged: #merge #dictionaries
ADD COMMENT
Topic
Name
8+2 =