![]() | ![]() |
Indentation is used for categorization program lines into a block in Python. The amount of indentation to use in Python depends entirely on the programmer. However, it is important to ensure consistency. By convention, four whitespaces are used for indentation instead of using tabs. For example:
Point to Note
I will explain what kind of program this is later. Indentation in Python also helps make the program look neat and clean. Indentation creates consistency. However, when performing line continuation indentation can be ignored. Incorrect indentation will create an indentation error. Correct python programs without indentation will still run, but they might be neat and consistent from human readability view.