What does block mean?

A group of lines that belong together and run as one unit: the body of an if, a loop or a function. In Python a block is marked by indentation.

In a lesson

The two lines pushed in by four spaces are a block: a group of lines that belong to the if line above them. The if line ends with a colon :, which is Python's way of saying "a block starts on the next line".

Learn it

Used in

and 28 more lessons.

Do the lesson in the simulator

All glossary terms