title: Adding values of one dictionary if the keys match the keys of the other dictionary
body: <p>I am new to python. I'd like to ask for your assistance regarding operations with dictionaries. I guess, the question is a bit basic. But, I'm kinda stuck. 
  I need to get the total of values in dict2 corresponding the "JJ" values in dict1. Since "JJ" in dict1 is associated with keys "A" and "B", the corresponding values in dict2 are 30 and 100, which sums to 130
  Thank you!
  Rn</p>
  
  <p>My code (I'm getting the sum of all values in dict2=145 after step 2 instead of just A+B=130)</p>
  
  <pre><code>dict1 = {"A":"JJ", "B":"JJ", "C":"X"}
  dict2 = {"A":30, "B":100, "C":15}
  dict3=dict()
  for (kk, vv) in dict1.items():
      ref_val="JJ"
      if vv == ref_val:
          dict3[kk] = vv
  print(dict3)
  
  total_points=0
  for (kk, vv) in dict2.items(): 
      for (kk, vv) in dict3.items(): 
          total_points = sum(vv for vv in dict2.values())
  print(total_points)
  </code></pre>