Python IndentationError Exception
Example
An IndentationError
will occur if indentation is missing:
if 5 > 2:
print("Five is greater than two!")
Try it Yourself »
Definition and Usage
The IndentationError
exception occurs when indentitation is missing, or is wrong.
You have to use the same number of spaces in the same block of code, otherwise you get an IndentationError
.
More Examples
Example
An IndentationError
will occur if you use wrong indentation:
if 5 > 2:
print("Five is greater than two!")
print("Makes sence!")
Try it Yourself »