title: Indentation of an IF-ELSE block in Python
body: <p>I am Python newbie and I am working on <a href="https://en.wikipedia.org/wiki/Natural_language_processing" rel="nofollow noreferrer">NLP</a> using Python. I am having an error in writing an <em>if-else</em> block in Python. When I am writing only an <em>if</em> block at that time it is working fine:</p>
  <pre><code>if xyzzy.endswith('l'):
      print xyzzy
  </code></pre>
  <p>After entering a colon (<kbd>:</kbd>) I am pressing <kbd>Enter</kbd> and it is automatically taking me to the correct indentation.</p>
  <p>But when I am trying to add an <em>else</em> block to it after pressing the <kbd>Enter</kbd> key after the print statement, it is considering it to be statement of an <em>IF</em> block only, so it is giving me incorrect indentation as I want an <em>else</em> block after, while when I am trying to write else block my self it is giving me this error.</p>
  <pre><code>else:
     ^
  </code></pre>
  <p><code>IndentationError: unexpected indent</code></p>
  <p>What should I do after writing print statement? <kbd>Enter</kbd> is clearly not working, because it is taking the cursor forward, while when I use <kbd>space</kbd> to come to the correct pointer it is giving me an error.</p>