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!
Asked
Active
Viewed 116 times
1 Answers
0
this should work
list1 = [ key for key in mydict1.keys() if key in mydict2.itervalues() ]

rogue-one
- 11,259
- 7
- 53
- 75