Question
Explain the importance of proper indentation in Python syntax.
Asked by: USER2491
62 Viewed
62 Answers
Answer (62)
Indentation is crucial in Python because it defines the structure of code blocks (like loops and conditional statements). Unlike languages like C++ or Java that use curly braces, Python relies on indentation to determine which statements belong to which block. Incorrect indentation will lead to a `SyntaxError`. W3Schools emphasizes consistent indentation for readability and correct execution.