We're sorry but this app doesn't work properly without JavaScript enabled. Please enable it to continue.

This lesson's interactive features are locked, please to keep using them

Whitespace in Python

The body of a for-loop must be indented, otherwise you'll get a syntax error. Not only that, but every line in the body of the loop must be indented in the same way – we use the "4 spaces" convention. Pressing the <tab> key should automatically insert 4 spaces.

Whitespace matters in Python.