title: Python | Give list [1,2,3,4] -> return 1*2+2*3+3*4
body: <p>So as i said in the title, i want to multipy each two neigbors in the list and sum them all - with a single code line.</p>
  <p>I'm looking for the most elegant and efficient method, without using extra memory or such.</p>
  <p>Here's what I do have now:</p>
  <pre><code>import numpy as np
  G = lambda array: sum(np.multiply(array[:-1], array[1:])))
  </code></pre>
  <p>That works, but when i write <code>array[:-1]</code> and <code>array[1:]</code>, doesn't it create two new arrays? If so, is there a way to do that with the same original array?</p>
  <p>Or maybe you can come up with a nicer way to do that :)</p>