In the below shown dictionaries i want to check whether the key in aa matches the key in bb and also the value corresponding to it matches in bb or not.Is there a better way
If you want to iterate over all matching key/value pairs, you can use
for key, value in aa.viewitems() & bb.viewitems(): ...
(Python 2.7)