Nishu

nishumsn03@gmail.com

What is indentation?

Posted on January 28, 2021



Indentation indicates to the spaces at the starting of the  code.Indentation is very important in Python. It can be block of the code if the spaces are not correct.You have to use the same number of spaces in the same block of code. we can't skip the indentation in any condition.

It is use in loop(eg for, while, if) and etc.. We have to give atleast one space in loops otherwise it will count as syntax error.


Sign In for comment and like the post.
pythonds

Nice explanation...


vishavjeet

At-least one space, are you sure? I think spaces 2,4,6,8..


Nishu

Yes, The number of spaces is up to you , but atleast 1 space has to be used.Also You have to use the same number of spaces in the same block of code, otherwise will get an error: