title: Calculating average in python using while loop
body: <p>Alright, I'm stumped on creating a function in python that uses a while loop to calculate an average. Using a for loop is simple, but I don't get how to recreate this function using a while loop instead.</p>
  
  <pre><code>def average(list):
      total = 0.0
      for number in list:
          total = total + number
      return total / len(list)
  </code></pre>
  
  <p>Could anyone give me a hand in how to use a while loop for this function?</p>