title: Adding input validation to my Rock Paper Scissor PYTHON
body: <p>I am trying to add input validation to this so the user can only enter ROCK, rock, PAPER, paper, SCISSORS or scissors. I am unsure about where to add it, and really how to do it as an if statement.
  Any help is greatly appreciated. Of course I would need to finish the game after they corrected their answer</p>
  
  <pre><code>import random
  
  
  def main():
      x = random.randint(1, 3)
      rock = "ROCK, rock"
      paper = "PAPER, paper"
      scissors = "SCISSORS, scissors"
      if x == 1:
          x = 'ROCK'
      elif x == 2:
          x = 'PAPER'
      elif x == 3:
          x = 'SCISSORS'
      guess = raw_input('rock, paper or scissors?: ')
      print('CPU: ', x, 'Player: ', guess)
      result = winner(x, guess)
      if result == 'tie':
          print('Its a tie try again!')
          main()
      else:
          print(result, 'Wins')
  
  def winner(x, guess):
      if guess == 'scissors' and x == 'ROCK':
          win = 'rock'
          return win
      elif guess == 'paper' and x == 'SCISSORS':
          win = 'scissors'
          return win
      elif guess == 'paper' and x == 'ROCK':
          win = 'paper'
          return win
      elif guess == 'rock' and x == 'PAPER':
          win = 'paper'
          return win
      elif guess == 'rock' and x == 'SCISSORS':
          win = 'rock'
          return win
      else:
          win = 'tie'
          return win
  if __name__ == '__main__':
      main()
  </code></pre>