-2

let's say I have 2 dictionaries in python. in the first dictionary I have a key 'Obama' and I want to know if there's a key like that found in the other dictionary's "values"(not keys). thanks!

Grosh
  • 3
  • 1

1 Answers1

0

this should work

list1 = [ key for key in mydict1.keys() if key in mydict2.itervalues() ]
rogue-one
  • 11,259
  • 7
  • 53
  • 75