title: Using return in a function to assign a choice value in a menu
body: <p>How can I use the <code>choice</code> variable in my <code>menu()</code> function to return the choice to my while loop?</p>
  
  <pre><code>def menu():
      print("MENU")
      print("1) Test")
      print("2) Quit")
      choice = int(input("\nChoose an option : "))
      return choice
  
  while choice != 2 :
      menu()
      if choice == 1 :
          do_this
      elif choice == 2 :
          print("This program will terminate.") 
          break
  else :
      print("Invalid option... ")
  </code></pre>