Comparing value in two dictionaries?

Arnaud Delobelle arnodel at googlemail.com
Sat Nov 15 13:25:51 EST 2008


Arnaud Delobelle <arnodel at googlemail.com> writes:

> Or to obtain a dictionary of differences:
>
>     dict((k, (v, dic2[v]) for k, v in dic1.iteritems()
>                           if dic2[v] != v)
                                    ^
                              Should be k of course!

-- 
Arnaud



More information about the Python-list mailing list