Control flow

The flow of the code is the order in which the statements, functions or instructions are executed. By default the code is executed line by line:

But this order can be altered in different ways, and these modifications are known as control flow. We could:

To understand the control of the flow of execution we need to understand the concept of a block of code. A block is a set of lines that are grouped together, for instance, the set of lines that will be executed only when a given condition if met.