I am trying to merge the following python dictionaries as follow:
dict1= {\'paul\':100, \'john\':80, \'ted\':34, \'herve\':10} dict2 = {\'paul\':\'a\', \'joh
This will work:
{k: [dict1.get(k), dict2.get(k)] for k in set(dict1.keys() + dict2.keys())}
Output:
{'john': [80, 'b'], 'paul': [100, 'a'], 'peter': [None, 'd'], 'ted': [34, 'c'], 'herve': [10, None]}