title: How to store results from while loop and sentinel in python?
body: <p>been working on this for hours, thought i had it down but it turns out i have it all wrong. </p>
  
  <p>The assignment is to </p>
  
  <p><strong>Write a program that computes your semester average and letter grade for the course</strong></p>
  
  <p>*******The user will enter these numbers:******</p>
  
  <ul>
  <li><p>A <strong>list</strong> of quiz scores. Each score is in the range 0–10. The user enters the sentinel value –1 to end the input. Drop the lowest quiz score.*</p></li>
  <li><p>A <strong>list</strong> of project scores. Each score is in the range 0–10. The user enters the senti- nel value –1 to end the input. Do not drop the lowest program score.*</p></li>
  <li><p>Two midterm exam scores. Each score is in the range 0–100*</p></li>
  <li><p>A final exam score. Each score is in the range 0–100."</p></li>
  </ul>
  
  <p>And here is my code</p>
  
  <pre><code>    qsum = 0
      psum = 0
      count = 0
  
  while True:
      q1 = float(input("Quiz #1 ----- "))
      if q1 &lt; 0:
          break
      qsum = qsum + q1
      lowest = q1
      q2 = float(input("Quiz #2 ----- "))
      if q2 &lt; 0:
          break
      qsum = qsum + q2
      if lowest &gt; q2:
          lowest = q2
      q3 = float(input("Quiz #3 ----- "))
      if q3 &lt; 0:
          break
      qsum = qsum + q3
      if lowest &gt; q3:
          lowest = q3
      q4 = float(input("Quiz #4 ----- "))
      if q4 &lt; 0:
          break
      qsum = qsum + q4
      if lowest &gt; q4:
          lowest = q4
      q5 = float(input("Quiz #5 ----- "))
      if q5 &lt; 0:
          break
  
  print("Quiz #1 ----- ",q1)
  print("Quiz #2 ----- ",q2)
  print("Quiz #3 ----- ",q3)
  print("Quiz #4 ----- ",q4)
  print("Quiz #5 ----- ",q5)
  
  while True:
          p1 = float(input("Program #1 -- "))
          if p1 &lt; 0:
              break
          psum = psum + p1
          p2 = float(input("Program #2 -- "))
          if p2 &lt; 0:
              break
          psum = psum + p2
          p3 = float(input("Program #3 -- "))
          if p3 &lt; 0:
              break
      #and so on#
  
  if 90 &lt;= total &lt;= 100:
      print("Grade ------ A")
  if 80 &lt;= total &lt; 90:
      print("Grade ------ B")
  if 70 &lt;= total &lt; 80:
      print("Grade ------ C")
  if 60 &lt;= total &lt; 70:
      print("Grade ------ D")
  if 0 &lt;= total &lt; 60:
      print("Grade ------ F")
  </code></pre>
  
  <p>Here is what the print out needs to look like</p>
  
  <pre><code>Quiz #1 ----- 10
  Quiz #2 ----- 9.5
  Quiz #3 ----- 8
  Quiz #4 ----- 10
  Quiz #5 –---- -1
  Program #1 -- 9.5
  Program #2 -- 10
  Program #3 -- 9
  Program #4 -- -1
  Exam #1 ----- 85
  Exam #2 ----- 92
  Final Exam -- 81
  Average ----- 89.4
  Grade ------- B
  </code></pre>
  
  <p>Unfortunately i didnt think about the fact that he probably wants this all in one single loop without fifty if statements and without specifying each quiz, he wants it to count through however long until the sentinel is entered. But i cant figure out how to do that? How do i store the information each time through the loop so i can get the desired output? </p>
  
  <p>So yeah im a little lost, any direction is very helpful, im struggling. Thanks guys. </p>