1. A while loop whose body never changes what the test reads
the whole question on paper; on an assignment the autograder times out, and every test of that function is marked 0What not to write
“choice = input('Choice: ') then while choice != 'q': and the cascade of ifs, then print('bye'). It works, I typed q and it stopped.”
What to write
“The body must re-read choice, on its last line: choice = input('Choice: ') inside the loop, after the cascade. Or while True: with the read first and if choice == 'q': break right after it.”
Why: It stopped for you because you typed q FIRST. On any other input the test reads the same value for ever, since nothing in the body assigns to choice. The check takes five seconds and needs no computer: name the variable in the condition, then find the line of the body that changes it. No line, no exit.