title: Why isn't my python shell indenting automatically?
body: <p>I've been given a question:</p>
  
  <p>Write a piece of Python code that prints out one of the following messages:</p>
  
  <p>"string involved" if either VarA or VarB are strings</p>
  
  <p>"bigger" if VarA is larger than VarB</p>
  
  <p>"equal" if VarA is equal to VarB</p>
  
  <p>"smaller" if VarA is smaller than VarB</p>
  
  <hr>
  
  <p>Here's my solution:</p>
  
  <pre><code>if type(varA) == str or type(varB) == str:
      print("string involved")
  elif varA&gt;varB:
      print("bigger")
  elif varA==varB:
      print("equal")
  else:
      print("smaller")
  </code></pre>
  
  <p>This looks exactly the same as the given answer, but it is incorrect, and I think it has something to do with my indentation. For some reason, after the <code>if</code> statement on the first line, the shell doesn't automatically indent the next line automatically. Why is this? I had to press TAB after each line that followed an <code>if</code> or <code>elif</code> statement. Also, what exactly is wrong with the code that I've written?</p>
  
  <p>Edit: The correct answer is:</p>
  
  <pre><code>if type(varA) == str or type(varB) == str:
      print('string involved')
  elif varA &gt; varB:
      print('bigger')
  elif varA == varB:
      print('equal')
  else:
      # If none of the above conditions are true,
      # it must be the case that varA &lt; varB
      print('smaller')
  </code></pre>
  
  <p>Not only do I want to know where I've gone wrong (everything seems correct), but I'd also like to know why the Spyder shell is not automatically indenting lines beginning with <code>elif</code> or <code>else</code>.</p>