Block
A block of code is a set of statements, functions or instructions that are grouped together. In most programming languages the blocks of code are created by using curly braces ({}). For instance, in C the statements executed when a test condition is met would be written as:
if (testCondition) {
statement1;
statement2;
statement3;
}
In Python a block of code is created by using indentation.
- In the if and for the code starts with a colon (:)
- The next line after the colon should be indented
- The block ends when the indentation goes back to the previous level.
The standard is to create the indentation by using four spaces.