title: Python menu-driven programming
body: <p>For menu-driven programming, how is the best way to write the Quit function, so that the Quit terminates the program only in one response.</p>
  
  <p>Here is my code, please edit if possible:</p>
  
  <pre><code>print("\nMenu\n(V)iew High Scores\n(P)lay Game\n(S)et Game Limits\n(Q)uit")
  choose=input("&gt;&gt;&gt; ")
  choice=choose.lower()
  while choice!="q":
      if choice=="v":
          highScore()
          main()
      elif choice=="s":
          setLimit()
          main()
      elif choice=="p":
          game()
          main()
      else:
          print("Invalid choice, please choose again")
          print("\n")
  print("Thank you for playing,",name,end="")
  print(".")
  </code></pre>
  
  <p>When the program first execute and press "q", it quits. But after pressing another function, going back to main and press q, it repeats the main function.
  Thanks for your help.</p>