title: Python how to reduce multiple lists?
body: <p>I am able to use <code>map</code> and <code>sum</code> to achieve this functionality, but how to use <code>reduce</code>?</p>
  
  <p>There are 2 lists: <code>a</code>, <code>b</code>, they have same number of values. I want to calculate </p>
  
  <pre><code>a[0]*b[0]+a[1]*b[1]+...+a[n]*b[n]
  </code></pre>
  
  <p>The working version I wrote using <code>map</code> is</p>
  
  <pre><code>value =  sum(map(lambda (x,y): x*y, zip(a, b)))
  </code></pre>
  
  <p>How to use <code>reduce</code> then? I wrote:</p>
  
  <pre><code>value =  reduce(lambda (x,y): x[0]*y[0] + x[1]*y[1], zip(a, b)))
  </code></pre>
  
  <p>I got the error "<code>TypeError: 'float' object is unsubscriptable</code>".</p>
  
  <p>Can anyone shed some light on this?</p>