Well, you have your number input outside of the loop, and declare your list after it's done executing. For what you described, the basic structure of your program might look like this:
MyList = [] while True: userInput = input("string that asks for a number or gives directions") if userInput == 'q': break elif #other conditionsBasically, you will continue asking for input until the user types in 'q'. The elif statement could be the first of several, checking for each of the different conditions you described.