Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

python merge two dictionaries

d1 = {'name': 'Alex', 'age': 25}
d2 = {'name': 'Alex', 'city': 'New York'}
merged_dict = {**d1, **d2}
print(merged_dict) # {'name': 'Alex', 'age': 25, 'city': 'New York'}
Source by www.python-engineer.com #
 
PREVIOUS NEXT
Tagged: #python #merge #dictionaries
ADD COMMENT
Topic
Name
8+6 =