title: All possible combinations of value-pairs (2-item tuples) in a sequence - PYTHON 2.7
body: <p>I'm having a math brain fart moment, and google has failed to answer my quandary. </p>
  
  <p>Given a sequence or list of 2 item tuples (from a Counter object), how do I quickly and elegantly get python to spit out a linear sequence or array of all the possible combinations of those tuples? My goal is trying to find the combinations of results from a Counter object.....</p>
  
  <p>For example clarity, if I have this sequence:  </p>
  
  <pre><code>[(500, 2), (250, 1)]  
  </code></pre>
  
  <p>Doing this example out manually by hand, it should yield these results:</p>
  
  <pre><code>250, 500, 750, 1000, 1250. 
  </code></pre>
  
  <p>Basically, I THINK it's a*b for the range of b and then add the resulting lists together...
  I've tried this (where c=Counter object):</p>
  
  <pre><code>res = [[k*(j+1) for j in range(c[k])] for k in c]
  </code></pre>
  
  <p>And it will give me back:</p>
  
  <pre><code>res = [[250], [500, 1000]]
  </code></pre>
  
  <p>So far so good, it's going through each tuple and multiplying x * y for each y... But the resulting list isn't full of all the combinations yet, the first list [250] needs to be added to each element of the second list. This would be the case for any number of results I believe.</p>
  
  <p>Now I think I need to take each list in this result list and add it to the other elements in the other lists in turn. Am I going about this wrong?  I swear there should be a simpler way. I feel there should be a way to do this in a one line list comp.</p>
  
  <p>Is the solution recursive? Is there a magic import or builtin method I don't know about? My head hurts......</p>