title: subtract the first and last element of a list in python
body: <p>I've got following list:</p>
  
  <pre><code>&gt;&gt;&gt; list_of_lists = [[(0, 0)], [(6, 0)], [(7, 0), (8, 0), (9, 0)], [(10, 0)]]
  </code></pre>
  
  <p>And what I want is the following:</p>
  
  <pre><code>&gt;&gt;&gt; substract(list_of_lists)
  [6, 1, 1]
  </code></pre>
  
  <p>Basically I have a list of lists. Each of those lists is a list of tuples. I want to to subtract the first element of the last tuple in a list from the first element of the first tuple in the subsequent list. For a more pictographic explanation,</p>
  
  <p>[[(<em>0</em>, 0)], [(<em>6</em>, 0)], [(<em>7</em>, 0), (8, 0), (<strong>9</strong>, 0)], [(<strong>10</strong>, 0)]]</p>
  
  <p><em>6</em> - <em>0</em> = <em>6</em></p>
  
  <p><em>7</em> - <em>6</em> = 1</p>
  
  <p><strong>10</strong> - <strong>9</strong> = 1</p>