title: Python While Loop Test Scores
body: <p>I'm trying to create a python program that calculates the average of test scores and terminates when you enter -1. However, I'm having trouble getting it to also ignore test scores that are over 100. I want the program to take say the scores 90, 80, 105, 84, -1 and calculate the average of the 1st, 2nd, and 4th scores skipping the 3rd because it's over 100 and terminating with the-1</p>
  
  <p>Here is what I have: </p>
  
  <pre><code>def main():
      sum = 0.0
      count = 0
      x = input("Enter a number (enter -1 to terminate) &gt;&gt; ")
      while x &gt;= 0:
          sum = sum + x
          count = count + 1
          if x&gt;100:
              break
          x = input("Enter a number (enter -1 to terminate) &gt;&gt; ")
      print "\nThe average of the numbers is", sum / count
      return
  main()
  </code></pre>