title: Python code for sum with condition
body: <p>The task is following: sum the list elements with even indexes and multiply the result by the last list's elemet.
  I have this oneliner solution code in Python. </p>
  
  <pre><code>array = [-37,-36,-19,-99,29,20,3,-7,-64,84,36,62,26,-76,55,-24,84,49,-65,41] 
  print sum(i for i in array if array.index(i) % 2 == 0)*array[-1] if array != [] else 0
  </code></pre>
  
  <p>My result is -1476 ( The calculation is: 41*(-37-19+29+3-64+36+26+55+84-65) )</p>
  
  <p>The right result is 1968.</p>
  
  <p>I can't figure it out why this code is not working correctly in this particular case.</p>