title: How do I sum the first value in each tuple in a list of tuples in Python?
body: <p>I have a list of tuples (always pairs) like this:</p>
  
  <pre><code>[(0, 1), (2, 3), (5, 7), (2, 1)]
  </code></pre>
  
  <p>I'd like to find the sum of the first items in each pair, i.e.:</p>
  
  <pre><code>0 + 2 + 5 + 2
  </code></pre>
  
  <p>How can I do this in Python? At the moment I'm iterating through the list: </p>
  
  <pre><code>sum = 0
  for pair in list_of_pairs:
     sum += pair[0]
  </code></pre>
  
  <p>I have a feeling there must be a more Pythonic way.</p>