How to return the values of dictionary key that has gained new values in a different dictionary
2
I have question a bit similar to:Replacing the value of a Python dictionary with the value of another dictionary that matches the other dictionaries key However in my case I got two dictionaries dict1 = {'foo' : ['val1' , 'val2' , 'val3'] , 'bar' : ['val4' , 'val5']} dict2 = {'foo' : ['val2', 'val10', 'val11'] , 'bar' : ['val1' , 'val4']} What I want to return is dict3 = {'foo' : ['val10', 'val11'] , 'bar' : ['val1']} and the opposite which is dict4 = {'foo' : ['val1', 'val3'] , 'bar' : ['val5']} where dict3 returns a dictionary of the values the keys 'foo' and 'bar' has gained in dict2 and...