For example, let\'s say I have to dictionaries:
d_1 = {\'peter\': 1, \'adam\': 2, \'david\': 3}
and
d_2 = {\'peter\': 14, \
One way is to check for symmetric difference (new set with elements in either s or t but not both):
set(d_1.keys()).symmetric_difference(set(d_2.keys()))
But a shorter way it to just compare the sets:
set(d_1) == set(d_2)