What is 'Indentation' and why is it so strict in Python?

Asked by kemiadewale · 4 months ago

1 Answer

36
amorebise · 4 months ago Top Answer

Indentation is just the space at the beginning of a line. In Python, it's not just for beauty; it's how the computer knows which lines of code belong together.

Think of it like a school assembly in Ibadan. Students from SS1 stand in one line, SS2 in another. If you step out of your line, the teacher gets confused. If you miss your indentation, Python will throw an 'IndentationError'. It’s just Python's way of keeping things organized.

Log in to add a comment.