title: lambda function to sum products of values from a dictionary
body: <pre><code>my_dict = {'a1':2,'a2':3,'b1':1,'b2':5,'b3':8}
  </code></pre>
  
  <p>I want to sum the products of labels 'a' and 'b' with the same numbers.</p>
  
  <pre><code>result = a1*b1 + a2*b2
  </code></pre>
  
  <p>note: b3 is ignored, since it has no corresponding a3.</p>
  
  <p>my code:</p>
  
  <pre><code>result = sum (lambda x * y, if str(key)[0] == a and str(key)[0] ==b and str(key)[1] == str(key)[1], my_dict) 
  </code></pre>