title: Having a syntax error while trying to create a random number generating game
body: <p>I cannot figure out why I'm having this syntax error. It says number is not defined but 'number' is set to 'raw_input'. Can anyone help me out? Here's the code and error message-</p>
  
  <pre><code>def main():
  
  number = raw_input('I have a number between 1 and 10. Can you guess it? Please type your first guess: ')
  
  guess(number)
  
  
  def guess(number):
      randomNumber = random.randrange(1,10)
  
  
   correct = False
  
  while not correct:
  
  if number &gt; randomNumber:
          print'Too High. Try again.'
      elif number &lt; randomNumber:
          print'Too Low. Try again.'
      elif number == randomNumber:
          print'Correct!'
  
  playAgain = raw_input('Excellent! You guessed the number! Would you like to play again (y or n)? ')
          if playAgain == 'y':
              main()
  
  
  
  Traceback (most recent call last):
    File "&lt;pyshell#48&gt;", line 2, in &lt;module&gt;
      if number &gt; randomNumber:
  NameError: name 'number' is not defined
  </code></pre>