Lesson 01
Flow Control Statements — Overview
Learn Python flow control: conditional, looping, and transfer statements. Decide once, repeat finitely, or jump control between program parts.
What you will learn
Flow control lets Python decide, repeat, and transfer execution.
The purpose of flow control statements is to perform a certain operation only once (when a condition is true or false), perform an operation repeatedly for a finite number of times until a test condition becomes false, or transfer control from one part of the program to another.
Three types of flow control
In Python, flow control statements are classified into 3 types:
| Type | Also called | Purpose |
|---|---|---|
| I. Conditional | Selection / Branching | Perform a task once based on condition evaluation |
| II. Looping | Iterative / Repetitive | Perform a task repeatedly until condition becomes false |
| III. Transfer | Jump statements | Move PVM control from one part of the program to another |
Complete module roadmap
I. Conditional (Selection / Branching)
Perform X-Operation when the condition is true, or Y-Operation when false.
| # | Lesson | Topics |
|---|---|---|
| 02 | Simple if |
Independent condition blocks |
| 03 | if..else |
Mutually exclusive branches |
| 04 | if..elif..else |
Multi-way decision chain |
| 05 | match..case |
Menu-driven pre-designed conditions (Python 3.10+) |
II. Looping (Iterative / Repetitive)
Perform an operation repeatedly for a finite number of times until the test condition becomes false.
| # | Lesson | Topics |
|---|---|---|
| 06 | while / while..else |
Counter-driven repetition |
| 07 | for / for..else |
Iterate over iterable objects |
When you write any loop program, remember 3 points:
- Initialization — where to start
- Conditional — where to stop
- Updation — increment or decrement
III. Transfer flow statements
| # | Lesson | Keyword |
|---|---|---|
| 08 | break |
Exit loop early |
| 09 | continue |
Skip to next iteration |
| 10 | pass |
Placeholder — ignore block |
| — | return |
Covered in Functions module |
Advanced
| # | Lesson | Topics |
|---|---|---|
| 11 | Nested loops | for-in-for, while-in-while, mixed |
| 12 | Practice programs | Combined interview-style problems |
Before you start
You should be comfortable with Operators, Data Types, and Collections — loops often iterate over strings, lists, and range.
Knowledge check
Q1: How many main families of flow control are in Python?
Answer: Three — conditional, looping, and transfer.
Q2: What are the three parts every loop needs?
Answer: Initialization, condition, and updation.
Loading playground…