title: Calculating area under curve from x, y coordinates
body: <p>Say I have two lists called <code>x</code> and <code>y</code>, both which contain numbers (coordinates), say that:</p>
  
  <pre><code>x = [0, 1, 2, 3, 4, 4, 5]
  y = [0, 1, 3, 3, 5, 6, 7]
  </code></pre>
  
  <p>I would need to calculate the area under the curve that is formed when combining these two lists to (x, y) coordinates. I don't really understand how to create a function that could calculate the area out of this information.</p>
  
  <p>i.e.</p>
  
  <pre><code>def integrate(x, y):
  """ x &amp; y = lists, area_under_curve = float value of the area """
      area_under_curve = 0
      last_x = x[0]
      last_y = y[0] 
  
      for cur_x, cur_y in list(zip(x, y))[1:]:
         ## some code here
  
      return area_under_curve
  </code></pre>