Comparing value in two dictionaries?

bearophileHUGS at lycos.com bearophileHUGS at lycos.com
Sat Nov 15 14:59:39 CET 2008


Gilles Ganault:
> I fill two dictionaries with the same number of keys, and then need to
> compare the value for each key, eg.

Probably using the DBMS capabilities you can find a better solution.

Are the keys equal? If you want to do it using dicts, you can iterate
on one dict, with iteritems, and then using the key look for the value
of the second dict, to see if they are the same, to collect
differences, etc.

Bye,
bearophile



More information about the Python-list mailing list