-1

I have a problem which is IndentationError: unexpected indent

the code is working good on shell but not on code.

Cœur
  • 37,241
  • 25
  • 195
  • 267
Marco Dinatsoli
  • 10,322
  • 37
  • 139
  • 253

1 Answers1

1

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"
Abhishek
  • 5,649
  • 3
  • 23
  • 42