I am creating a function that accepts a dictionary1 and checks if any of the keys exists as a value dictionary2.
I have tried using the
dictionary2.isdisjoint(dictionary1) but this is effective for only checking keys-keys.
How can I check key to value in Python?
Not sure if this is really a big enough task to put into a separate function, but anyway, here's an example using the any() keyword:
if any(k in d2.values() for k in d1.keys()): # do stuff