What happens if I forget to indent the code inside a loop?

Asked by kemiadewale · 6 months ago

1 Answer

29
amorebise · 6 months ago Top Answer

Python will be confused. It won't know which lines are part of the loop and which are just regular code. You will likely get an IndentationError.

In Python, the 'empty space' is actually information. It’s like a paragraph in a book—it shows where a new idea starts and ends.

Log in to add a comment.