title: Python - Why am I getting a ValueError here?
body: <p>Ok, I want to keep prompting the user for <code>choice</code> until they enter something not 1-5, but on some options (like 2 for example), the program goes straight to the "Goodbye" after ValueError:</p>
  
  <pre><code>   if(genRoster(fileName, recordsDict) and fileName != ""):
          hwPts = 250
          print("Select an option: ")
          try:
              choice = int(input("1) Get lab scores \n2) Get homework scores \n3) Get midterm exam scores \n4) Get final exam scores \n5) Get overall grades\n").strip())
              while(choice &gt; 0 and choice &lt; 6):
                  print("Name      %")
                  if(choice == 1):
                      for name in recordsDict.keys():
                          print(name+"      "+str(student.getLPGrade(recordsDict[name]))+"%") # 6 spaces
                      print("Class     "+str(getLpAvg(recordsDict))+"%\n")
                  elif(choice == 2):
                      for name in recordsDict.keys():
                          print(name+"      "+str(student.getHWGrade(recordsDict[name], hwPts))+"%") # 6 spaces
                      print('Class     % 1.1f' %getHwAvg(recordsDict, hwPts), "%\n")
  
                  elif (choice == 3):
                      for name in recordsDict.keys():
                          print(name + "      " + str(student.getMTGrade(recordsDict[name])) + "%")  # 6 spaces
                      print("Class     " + str(getMtAvg(recordsDict)) + "%\n")
                  elif (choice == 4):
                      for name in recordsDict.keys():
                          print(name + "      " + str(student.getFEGrade(recordsDict[name])) + "%")  # 6 spaces
                      print("Class     " + str(getFeAvg(recordsDict)) + "%\n")
                  elif (choice == 5):
                      for name in recordsDict.keys():
                          print(name + "      " + str(student.getOverallGrade(recordsDict[name], hwPts)) + "%")  # 6 spaces
                      print("Class     ", str(getOvAvg(recordsDict, hwPts)), "%\n")
                  print("Select an option: ")
                  choice = int(input("1) Get lab scores \n2) Get homework scores \n3) Get midterm exam scores \n4) Get final exam scores \n5) Get overall grades\n"))
          except ValueError:
              print("Goodbye! 2")
      else:
          print("Goodbye!")
  </code></pre>
  
  <p>the recordsDict is a dictionary holding student objects generated by </p>
  
  <pre><code>def genStud(studentName, labScores, hwScores, midtermScore, finalScore):
      return studentName, {"NAME": str(studentName).strip().title(), "LP": labScores, "HW": hwScores, "MT": int(midtermScore), "FE": int(finalScore)}
  </code></pre>
  
  <p>But this shouldnt affect the choice. What is happening here?</p>