How to solve indentation error in python?

Hi guys,

Today i am in mood to discuss the common indentation error in python code. We frequently get the indentation errors such as:

  1. IndentationError: unindent does not match any outer indentation level
  2. IndentationError: unexpected indent

To solve this very easily just type the following code in the command line:

python -m tabnanny yourfilename.py

Instead of yourfilename.py use your own python file name. This command will suggest the line where the indentation is not correct.

This is such easy way that you dont need python beautifier.

Hope this helps!! Thanks for your upcoming feedbacks.

You may also like...

Leave a Reply

Your email address will not be published. Required fields are marked *

ERROR: si-captcha.php plugin: GD image support not detected in PHP!

Contact your web host and ask them to enable GD image support for PHP.

ERROR: si-captcha.php plugin: imagepng function not detected in PHP!

Contact your web host and ask them to enable imagepng for PHP.