Module 05 of 11

Control Flow & Loops

Lessons

About This Module

With data structures to hold your values, the next step is directing what your program actually does with them. This module covers the tools Python gives you for making decisions and repeating work — the two things that turn a script into a real program.

It starts with conditionals: if, elif, and else statements, and how Python evaluates truthy and falsy values. From there it covers for and while loops for iterating over data and repeating code while a condition holds, then break, continue, and pass for fine-tuning exactly how a loop runs. It closes with match-case, Python's structural pattern matching syntax for cleaner multi-branch logic.

Watch the lessons in order, then continue on to Functions & Scope.

Lessons

4 videos
01

Python Tutorial for Beginners 6: Conditionals and Booleans - If, Else, and Elif Statements

Making decisions in your code with if, elif, and else statements, and understanding how Python evaluates Booleans and truthy/falsy values.

02

Python Tutorial for Beginners 7: Loops and Iterations - For/While Loops

Repeating code with for and while loops, iterating over sequences, and using range() to loop a fixed number of times.

03

Break, Continue and Pass | Python Tutorial for Beginners

Exiting a loop early with break, skipping to the next iteration with continue, and using pass as a placeholder statement.

04

Python Match Case Statements | Structural Pattern Matching

Using Python's match-case syntax to write cleaner multi-branch logic than a long chain of if/elif statements.