title: Count occurrence of tuples with Python
body: <p>I'm trying to convert a list of Python tuples that display product and cost to a list of tuples that display the cost and the count of products at a given cost.</p>
  
  <p>For example, given the below input:</p>
  
  <pre><code>[('Product1', 9), ('Product2', 1),
   ('Product3', 1), ('Product4', 2),
   ('Product5', 3), ('Product6', 4),
   ('Product7', 5), ('Product8', 6), 
   ('Product9', 7), ('Product10', 8), 
   ('Product11', 3), ('Product12', 1), 
   ('Product13', 2), ('Product14', 3), 
   ('Product15', 4), ('Product16', 5), 
   ('Product17', 6), ('Product18', 7)]
  </code></pre>
  
  <p>I'm trying to create a function in Python that would render the below. i.e. The value 1 is rendered 3 times for three different products, hence (1, 3).</p>
  
  <pre><code>[(1, 3), (2, 1), (3, 2), (4, 1), (5, 2), (6, 2), (7, 2), (8, 1) (9, 1)]
  </code></pre>