title: Get average difference between all numbers in a list (python)
body: <p>I have a list where I'd like to get a sense of the difference between all the numbers in it. Algorithmically, it seems like I should take the absolute value of the subtraction of each item from a list from each other and then to find the average of the sum of subtractions. <em>Don't worry about absolute value part. That's only relevant to my application.</em></p>
  
  <p>For example:</p>
  
  <pre><code>list_a = [1,2,3,4]
  
  list_a0 = (abs(1-2) + abs(1-3) + abs(1-4))/3 = 1+2+3 = 2
  list_a1 = (abs(2-1) + abs(2-3) + abs(2-4))/3 = 1+1+2 = 1.33
  list_a2 = (abs(3-1) + abs(3-2) + abs(3-4))/3 = 2+1+1 = 1.33
  list_a3 = (abs(4-1) + abs(4-2) + abs(4-3))/3 = 3+2+1 = 2
  avg = (lista0 + lista1 + lista2 + lista3)/4 = 1.67
  </code></pre>
  
  <p>I'm newer to python. Would someone be able to give a tip on how to loop through <code>list_a</code> to do this?</p>