title: How can I sum the product of two list items using for loop in python?
body: <p>I am trying to sum the product of two different list items in the same line using for loop, but I am not getting the output as expected.</p>
  
  <p><strong>My example code:</strong></p>
  
  <pre><code>a = [1,2,3]
  b = [4,5,6]
  
  sum = 0              # optional element
  
  score = ((sum+(a(i)*b(i)) for i in range(len(a)))
  
  print score
  </code></pre>
  
  <p><strong>output:</strong></p>
  
  <pre><code>&lt;generator object &lt;genexpr&gt; at 0x027284B8&gt;
  </code></pre>
  
  <p><strong>expected output:</strong></p>
  
  <pre><code>32                   # 0+(1*4)+(2*5)+(3*6)
  </code></pre>