title: How to print the sum of the current and previous element in a list
body: <p>I am trying to iterate through a list of numbers and print the sum of the current element and the previous element using python. For example, </p>
  
  <p>Given <code>numbers = [5,10,15,20,25,30,30]</code>, the output should be <code>5, 15, 25, 35, 45, 55, 60,</code>. This is the following code that I have tried, it is very close to the answer but the first element is wrong. </p>
  
  <pre class="lang-py prettyprint-override"><code>numbers = [5, 10, 15, 20, 25, 30, 30]
  
  i = 0
  for x in range(1, 8):
      print(numbers[i] + numbers[i - 1], end=", ")
      i += 1
  </code></pre>
  
  <p>I am getting the output <code>35, 15, 25, 35, 45, 55, 60,</code>. What am I doing wrong?</p>