How to prevent indentation errors?
Python doesn't like inconsitently mixed tabs and spaces for indentation.
Ctrl-T opens the property panel, check that the Tabs as Spaces is ticked.
You can usually fix this by unindenting the lines in question by Shift-Tab to the first column and re-indent them Tab again.

There is also the menu option available  Format &gt; Convert Whitespace &gt; To Spaces  (or to tabs)
Related:

https://stackoverflow.com/questions/5685406/inconsistent-use-of-tabs-and-spaces-in-indentation