🧩Indentation
Also known as Indent, Code Indentation, Tabs vs Spaces
The space at the start of a line. It shows which lines sit inside a block.
Think of it like
It is like a list with dots. The lines pushed in belong to the line above.
Example
Jack's Python code fails with an IndentationError. One line has 3 spaces instead of 4, so it does not line up.
Why it matters
Definition
Example code
python
for name in names:
print(name)
print("done")Common mistake
Key takeaways
- 1Shows nesting. Deeper lines sit inside outer ones.
- 2Rule in Python. Wrong spacing is an error there.
- 3Pick one style. Spaces or tabs, never both.