title: Function in Python giving weird set of errors, yet outputs the correct answer
body: <p>I am writing a function in Python that takes a list of lists of numbers and prints the averages on each line. But when I do so, it prints the answers, then gives an error block that I cannot find information about on the python documentation website.</p>
  
  <pre><code>def avg(lst):
  
      """lst is a list that contains lists of numbers; the
      function prints, one per line, the average of each list"""
  
      count = 0
      while count&lt;=(len(lst)):
          print(sum(lst[count])/(len(lst[count])))
          count = count + 1
  </code></pre>
  
  <p>When this is run with lst [[95, 92, 86, 87], [66, 54], [89, 72, 100], [33, 0, 0]] , it yields an output of:</p>
  
  <pre><code>&gt;&gt;&gt; avg([[95, 92, 86, 87], [66, 54], [89, 72, 100], [33, 0, 0]])
  90.0
  60.0
  87.0
  11.0
  
  Traceback (most recent call last):
    File "&lt;pyshell#38&gt;", line 1, in &lt;module&gt;
      avg([[95, 92, 86, 87], [66, 54], [89, 72, 100], [33, 0, 0]])
    File "&lt;pyshell#37&gt;", line 7, in avg
      print(sum(lst[count])/(len(lst[count])))
  IndexError: list index out of range
  </code></pre>
  
  <p>The answers are right, but I'm not sure why there's that error. Any ideas?</p>
  
  <p>EDIT: changed while count&lt;(len(lst)+1): to while count&lt;=(len(lst)): Still yields same error</p>