title: Calculate Average of list using recursion in python
body: <p>I need a function called average(a), where a is a list, and it returns the average of the elements using recursion. I solved it with an auxiliary function called sum (which solves recursively the sum of all elements of a list), but I want to solve it within the average function.<br>
  This is what I have tried:</p>
  
  <pre><code>def average(a):  
      if len(a)==1:  
          return a[0]  
      else:  
          return (a[0]+average(a[1:]))/len(a)  
  
  print(average([1,2,3]))  
  </code></pre>
  
  <p>It should return 2.0 in this case.
  The issue here is that when I call the function in the return I'm dividing again for <code>len(a)</code>. Thats not right.</p>