title: Complex expressions in python reduce
body: <p>Is there a smart way to sum a list, but actually perform a map type function prior to summing.</p>
  
  <p>I'm trying to combine these functions into one function that uses the lambda:</p>
  
  <pre><code>xlist = [1, 2, 3, 4]
  sum(map(lambda x: (x - 1.0)**2, xlist))
  
  # result = 14.0
  </code></pre>
  
  <p>I'm trying this:</p>
  
  <pre><code>reduce(lambda x, y: x + (y - 1.0)**2, xlist)
  
  # result = 15.0
  </code></pre>
  
  <p>But it is not the same result. What is the smartest way to solve this. I'm kind of curious, I know I can use <code>sum(map())</code> but I wonder if reduce can be used in this way. </p>