title: How do I sum the first two values in each tuple in a list of tuples in Python?
body: <p>I searched through stackoverflow but couldn't find an answer or adapt similar codes, unfortunately.
  The problem is that I have a list of tuples:</p>
  <pre><code>tupl = [(5,3,33), (2,5,2), (4,1,7)]
  </code></pre>
  <p>and I should use list comprehension to have this output:</p>
  <pre><code>[8,7,5]
  </code></pre>
  <p>The code that I wrote is a bit dump and is:</p>
  <pre><code>sum_tupl = []
  tupl = [(5,3,33), (2,5,2), (4,1,7)]
  sum_tupl = [tupl[0][0]+tupl[0][1] for tuple in tupl]
  sum_tupl
  </code></pre>
  <p>but instead of doing what I want it to do, it returns</p>
  <pre><code>[8,8,8]
  </code></pre>
  <p>which is the sum of the first couple executed three times.
  I tried using a variant:</p>
  <pre><code>tupl = [(5,3,33), (2,5,2), (4,1,7)]
  sum_tupl = [sum(tupl[0],tupl[1]) for tuple in tupl]
  sum_tupl
  </code></pre>
  <p>(which is missing something) but to no avail.</p>