Title: If Statement
Course: CPS 120: Introduction to Computer Science ~ Master (Aug/2015) OLD > Section: Learning Units

Python If statement:

- Is a statement with one or more conditions and one or more blocks of code.
- A condition is tested:
✓ If the condition is True, then a corresponding block of code executes.
✓ If the condition is False and there is another condition in the statement, that condition is tested.
- A block is a group of one or more statements that execute sequentially.

<block>
is the same as
statement-1;
statement-2;
…
statement-n;

There are several layouts, some of which you will explore on the next pages.