title: Alternating sum of integers in Python using lambda
body: <p>I need to write a simple function in Python that calculates the alternating sum of a list of integers. </p>
  
  <p>Example:  [ a1, a2, a3, ...] will be [a1 - a2 + a3 - a4...]</p>
  
  <p>I need to use a lambda function to implement this.</p>
  
  <p>So far I have</p>
  
  <pre><code>print reduce(lambda a,b : ((-a) + b), [10, 20, 30, 40])
  </code></pre>
  
  <p>which prints out 20; but it should print -20. </p>
  
  <p>What am I doing wrong?</p>