So far, each line of code that you have written gets executed exactly once and immediately after it is written. Compound statements are Python structures that allow you to control when and how certain pieces of code get executed. Compound statements significantly increase your expressiveness as a programmer. In other words, they allow you to do more with less code. Before introducing a few compound statements, it will be helpful to go over the syntactical structure.
A compound statement consists of two parts. The first part, the clause header, is a line containing the type of statement and some other information specific to the statement. The clause header always starts with the type of clause and ends with a colon. The following is the syntax of a clause header:
<clause type> <clause body>:
(Note that this figure and the next two are just to demonstrate the syntactical structure and do not represent functional code...