For Sublime Text Editor
Indentation Error generally occurs when the code contains a mix of both tabs and spaces for indentation. I have got a very nice solution to correct it, just open your code in a sublime text editor and find 'Tab Size'
in the bottom right corner of Sublime Text Editor and click it. Now select either
'Convert Indentation to Spaces'
OR
'Convert Indentation to Tabs'
Your code will work in either case.
Additionally, if you want Sublime text to do it automatically for you for every code you can update the Preference settings as below:-
Sublime Text menu > Preferences > Settings - Syntax Specific :
Python.sublime-settings
{
"tab_size": 4,
"translate_tabs_to_spaces": true
}