Given the two dictionaries:
dict1 = { 1:'A', 2:'B', 3:'C' }
dict2 = { 1:'X', 2:'Y' }
I need to intersect those dictionaries by keys (remove those entries which keys aren't available in both dictionaries) AND combine them into one dictionary with the list as values:
result = { 1:['A','X'], 2:['B','Y'] }
So far I've only merge those two dictionaries into one, but without removing mentioned entries with:
{key:[dict1[key], dict2[key]] for key in dict1}