compound statement

A statement such as if, for, while, def, class, try or with that has a heading ending in a colon and an indented block beneath it.

In more detail

The heading controls whether, how often or when the block runs. Forgetting the colon at the end of the heading is one of the most common syntax errors.

Related terms

Taught in

References