title: Python using a input in a function outside of the function?
body: <p>My code bellow keeps outputting an error as variable "user_option" (which is holding an input value) is not available outside of the function. How do i make it available so i can use it for my if statement?</p>
  
  <pre><code>def main_menu(str):
      print(str(1) + " Play game")
      print(str(2) + " High score")
      print(str(3) + " Joke")
      user_option = input("What option would you like to select? ")
      return(user_option)
  
  main_menu(str)
  
  if user_option == "1" or user_option == "Play game" or user_option == "play game":
  </code></pre>
  
  <p>The reason I want it as a function is I have an option for the user to return to main menu screen and input a new option.</p>