Your question is Merging Dictionaries in Python. Start with the requirements on the right.
Run and submit as often as you like. When you're ready, talk me through your approach or go straight to the code.
Macy's catalog pipelines may need to combine two dictionaries of product attributes, such as base details and updated merchandising values. Write a function that merges two dictionaries without modifying either input.
If both dictionaries contain the same key, the value from the second dictionary must override the value from the first. The result should be a new shallow dictionary containing every key from both inputs.
Implement merge_catalog_attributes(first, second):
first and second. Keys are strings, and values may be any Python value.second.def merge_catalog_attributes(first, second):