title: How to compare values of two different hash maps in python
body: <p>Hi i'm trying to figure out how to compare the values of two different hash maps that I have. </p>
  
  <pre><code>hash1 = {'animals':['dogs','cats']}
  hash2 = {'canine': ['dogs','wolves']}
  </code></pre>
  
  <p>From the example above, since the key canine in hash2 has a value 'dogs' matching with the key animals in hash1 which also has 'dogs', I want it to print out 'canine'. </p>
  
  <p>I was able to do something like this when a key only have one value, but I need it to have a long list of values and if any of the values match, I want it to print out which key it had any matches with. </p>
  
  <p>EDIT: 
  I want it to print out 'canine' because for example if I had multiple keys in hash2 </p>
  
  <pre><code>hash2 = {'canine':['dogs','wolves'],'domestic':['horse','rabbit']}
  </code></pre>
  
  <p>I would only want it to print out 'canine' because that's the one that matches, instead of printing out the entire hash2 </p>
  
  <p>EDIT 2:
      hash1 = {'animals':['dogs','cats']}
      hash2 = {'canine': ['dogs','wolves']}</p>
  
  <pre><code>for value in hash2.values():
      if value in hash1.values():
          #not sure how to write this so here's pseudocode
          print(hash2[key of matching value])
  </code></pre>