I have 2 lists, both of which contain same number of dictionaries. Each dictionary has a unique key. There is a match for each dictionary of the first list in the second list, that is a dictionary with a unique key exists in the other list. But the other elements of such 2 dictionaries may vary. For example:
list_1 = [
{
'unique_id': '001',
'key1': 'AAA',
'key2': 'BBB',
'key3': 'EEE'
},
{
'unique_id': '002',
'key1': 'AAA',
'key2': 'CCC',
'key3': 'FFF'
}
]
list_2 = [
{
'unique_id': '001',
'key1': 'AAA',
'key2': 'DDD',
'key3': 'EEE'
},
{
'unique_id': '002',
'key1': 'AAA',
'key2': 'CCC',
'key3': 'FFF'
}
]
I want to compare all elements of 2 matching dictionaries. If any of the elements are not equal, I want to print the none-equal elements.
Would you please help?