title: Why does my code run on one program but not the other?
body: <p>I am writing a simple number guessing game and I cannot get my code to execute in SublimeREPL or my console. The only way I can get it to execute in Team Treehouse's Workspaces program, and it works exactly the way it is supposed to. But in both my console and SublimeREPL it says there are multiple indentation errors. What gives?? I know python is finnicky about its indentation so I made sure to change my sublime settings so that each tab is four spaces but it still does not run - throws about ten indentation errors, but as far as I can tell everything is indented exactly how it is supposed to be. I have tried multiple searches with no results and I am at my wits end not being able to get such a simple program to run! I mean why would code work in one environment but not in another? I'm copying and pasting the code so it's not different...</p>
  
  <p>Here is the code:</p>
  
  <pre><code>import random
  
  #safely make an int
  #limit guesses
  #too high, too low, messages
  #play again
  
  def game():
      #generate number
      secret_number = random.randint(1, 10)
      guesses = []
  
      while len(guesses) &lt; 5:
          try:
              #get num guess from user
              guess = int(input("Guess a number between 1 and 10: "))
          except ValueError:
              print("That's not a valid number, try again.")
  
          else:
              #compare guess to secret number
              if guess == secret_number:
                  #print hit/miss
                  print("You got it! My number was {}".format(secret_number))
                  break
              else:
                  print("That's not it! Guess again!")
              guesses.append(guess)
  
  game()
  </code></pre>
  
  <p>Note this code works perfectly on Team Treehouse.
  Here is the error I receive in SublimeREPL and my terminal:</p>
  
  <pre><code>    Guess a number between one and ten: Traceback (most recent call last):
    File "&lt;stdin&gt;", line 2, in &lt;module&gt;
    File "&lt;string&gt;", line 1
      if guess == secret_num:
       ^
  SyntaxError: invalid syntax
  &gt;&gt;&gt;   File "&lt;stdin&gt;", line 1
      print("You got it!")
      ^
  IndentationError: unexpected indent
  &gt;&gt;&gt;   File "&lt;stdin&gt;", line 1
      break
      ^
  IndentationError: unexpected indent
  &gt;&gt;&gt;   File "&lt;stdin&gt;", line 1
      else:
      ^
  IndentationError: unexpected indent
  &gt;&gt;&gt;   File "&lt;stdin&gt;", line 1
      print("That's not it!") 
      ^
  IndentationError: unexpected indent
  &gt;&gt;&gt; &gt;&gt;&gt; 
  </code></pre>
  
  <p>I would seriously prefer to use tools other than Workspaces so I can have my own code on my machine, but I don't know if this code will even actually work or if I am just wasting my time learning junk...</p>