title: How to average user inputs with while loop using a sentinal value?
body: <p>For a classroom assignment I have been asked to create a program that averages a number of user input exam grades using a while loop. I have come up with a functioning program, however it does not meet the specific criteria required by my instructor.
  I need to Use a while-loop to allow the user to enter any number of exam scores, one number per line, until a sentinel value is entered.
  How might I alter this program to get the same result using a while loop and a sentinel value of 9999?</p>
  
  <p>here is what I have so far.</p>
  
  <pre><code>scores=int(input("how many test scores will you enter: "))
  total_sum=0
  for n in range(scores):
      numbers=float(input("Enter exam score : "))
      total_sum+=numbers
  avg=total_sum/scores
  print("average of ", scores, " test scores is :", avg)
  </code></pre>
  
  <p>The output should look something like this</p>
  
  <pre class="lang-none prettyprint-override"><code>Enter exam score. 9999 to quit: 100
  Enter exam score. 9999 to quit: 95.5
  Enter exam score. 9999 to quit: 90
  Enter exam score. 9999 to quit: 9999
  
  These 3 scores average to : 95.16666667
  </code></pre>