RosettaCodeData/Task/Associative-array-Merging/Python/associative-array-merging-2.py

8 lines
177 B
Python
Raw Permalink Normal View History

2023-07-01 11:58:00 -04:00
base = {"name":"Rocket Skates", "price":12.75, "color":"yellow"}
update = {"price":15.25, "color":"red", "year":1974}
result = base.copy()
result.update(update)
print(result)