“while loop” not breaking (using Python)
问题 This is my code : #Choose Report def chooseReport(): print "Choose a report." while True: choice = raw_input("Enter A or B: ") if choice == 'a' or choice == 'A': reportA() break elif choice == 'b' or choice == 'B': reportB() break else: continue When I input either a or b , it just asks me to "Enter A or B" again. It doesn't go to the functions its supposed to. Any idea why is this? 回答1: The code is perfect, except a redundant else, as mentioned in the comment. Are you entering a (a + space)