title: Python math adding numbers from two list index by index
body: <p>I am still a beginner in Python. I am trying to implement an algorithm that involves vector and normalised difference between the vector. The equation is given as </p>
  
  <pre><code>Sr = 1 - ( || r1 - r2|| / || r1 + r2|| )
  
  A given example gives r1 and r2 as shown below. 
  
  r1 = {1 2 3 4 5 6 0 3 3 0 0 0 1 1}
  r2 = {4 0 3 0 0 0 1 2 3 5 6 7 8 9}
  
  Sr = 0.2023
  </code></pre>
  
  <p>A breakdown of the formula would look something like this.</p>
  
  <pre><code>r1-r2 is the subtracting the item1 in r1 to the item1 in r2, subtracting the item2 in r1 to item2 in r2,..., until item-n in r1 and r2.
  
  Let's say M is the total sum of (r1-r2)
  M = sum(r1-r2) = sum[(1-4) + (2-0) +...+(1-9)]
  
  ||r1 - r2|| = math.sqrt(x)(math.(M, 2))
  </code></pre>
  
  <p>Basically I can do all the other math related functions but I am having problems finding an efficient way to calculate M where I need to add/subtract numbers from two list index by index. Any suggestions would be great. Thanks!</p>