title: Python: How can I restart a method without capturing any values?
body: <p>I created a Rock, Paper, Scissors game in Python, but I had trouble restarting the method if the player typed an invalid command. If the user types anything other than an 'r', 'p', or 's' the first time it asks, the value None will always be returned when a proper value is entered. I found I could just restart the round, but when I added a wager to the game it proved to be an inconvenience.</p>
  
  <pre><code>def get_input():
      choice = input("[R]ock, [P]aper, or [S]cissors? ").lower()
      if choice == 'r':
          return 'rock'
      elif choice == 'p':
          return 'paper'
      elif choice == 's':
          return 'scissors'
      else:
          print("That is not a valid command. Try again.")
          get_input()
  
  choice = get_input()
  print(choice)
  </code></pre>
  
  <p>The output when the user types an 'a' followed by a 'p':</p>
  
  <p>[R]ock, [P]aper, or [S]cissors? a<br>
  That is not a valid command. Try again.<br>
  [R]ock, [P]aper, or [S]cissors? p<br>
  None </p>