Indentation Error (इंडेंटेशन त्रुटि) :-
Python में Indentation (Space या Tab) का उपयोग Code Block (कोड ब्लॉक) को दर्शाने के लिए किया जाता है। यदि किसी Block (जैसे if, for, while, def आदि) के अंदर सही Indentation नहीं दी जाती, तो Python IndentationError दिखाता है।
English:
In Python, Indentation (spaces or tabs) is used to define a code block. If the code inside a block (such as if, for, while, def, etc.) is not properly indented, Python raises an IndentationError.
Wrong Example 1: Missing Indentation -
Output:
Correct Example
Output:
Wrong Example 2: Inconsistent Indentation -
Output:
Correct Example
Output: