title: Python3: Comparing a specific pair of keys and values between two dictionaries
body: <p><strong>EDIT: In case it helps with context, I am actually trying to generalize this to work in for and while loops, where I would want something like this to work</strong></p>
  
  <pre><code>if dictA[certainkey:'certainvalue'] == dictB[certainkey:'certainvalue']:
      return True
  </code></pre>
  
  <p><strong>Original Question:</strong>
  Is there a way to compare identical keys in two dictionaries in Python3 to see if they have the same values?</p>
  
  <p>For example, let's say</p>
  
  <pre><code>dictA = {1:'Y', 2:'E', 3:'E'}
  dictB = {1:'Y', 2:'A', 3:'W'}
  </code></pre>
  
  <p>I want the program to return me a True value if a certain set of key-value pairs in dictA matches the same set of key-value pairs in dictB. In this case, key 1 is paired to value 'Y' in both dictA and dictB. I didn't know if there were good ways to do this, so I naturally tried </p>
  
  <pre><code>print(dictA[1:'Y'] == dictB[1:'Y'])
  </code></pre>
  
  <p>hoping to get a True printed to me. Since it didn't work (and I don't know enough about dictionaries yet), I was wondering if there were alternative ways of doing this. Thanks!</p>