KnowledgeBoat Logo
|

Robotics & Artificial Intelligence

Write short notes on Indentation.

Python Funda

1 Like

Answer

Indentation is the fundamental aspect of Python programming that defines the structure and flow of code. Unlike many other programming languages that use curly braces { } or keywords to delimit blocks of code, Python relies on indentation levels to group statements. It refers to the aligning of a statement or group of statements which are part of another statement to get the desired execution of a specific block. All the statements within a block must be indented by the same amount, and it is a common practice to use 4 spaces per indentation level. Mixing tabs and spaces is not allowed and will result in an Indentation Error. Therefore, proper indentation is crucial in Python as it directly affects the execution of the code and its readability.

Answered By

2 Likes


Related Questions