Oct-10-2019, 03:19 PM
Hi,
I see this code to merge two dict with same key and I don't understand ,why in the final result is the key to the second dictionary (key b) taken as a final key?
RavCoder
I see this code to merge two dict with same key and I don't understand ,why in the final result is the key to the second dictionary (key b) taken as a final key?
>>> x = {'a': 1, 'b': 2} >>> y = {'b': 3, 'c': 4} >>> z = {**x, **y}The result is:
>>> z {'c': 4, 'a': 1, 'b': 3}Regards,
RavCoder