I have a problem which is IndentationError: unexpected indent
the code is working good on shell but not on code.
I have a problem which is IndentationError: unexpected indent
the code is working good on shell but not on code.
You are getting Indentation Error because you are mixing tabs or spaces anywhere in file. So you should convert all tabs to 4 spaces
or
If you want you can use tabs only but don't mix with spaces or else you will get Indentation Error again.
Also you said you keep mixing spaces and tabs so i advice you to enable showing Invisible characters so that you know you aren't mixing tabs and spaces.
In Notepad++ you can do that by :
View->Show Symbol->Show All Characters
or
View->Show Symbol->Show White Space and Tab
If you use Sublime Text 2, you can do this:
Go to Preferences -> Settings- default
Change
"draw_white_space": "selection"
to
"draw_white_space":"all"