Module 5: Control Flow

Beginner 15 chapters

56. Introduction to Conditional Statements

Understand what conditional statements are, how Python decides between actions using True and False, and how comparison and logical operators build conditions.

Beginner25 min

57. if Statement

Learn the if statement: how to run code only when a condition is true, how indentation defines the block, and how to write clean one-way decisions.

Beginner25 min

58. if-else Statement

Learn how if-else gives your program two paths: one block runs when a condition is true and another runs when it is false. Includes truthy values, ranges and the one-line conditional expression.

Beginner20 min

59. if-elif-else Statement

Use elif to choose between three or more outcomes. Learn how the ladder is checked top to bottom, why order matters, and when to use separate ifs instead.

Beginner25 min

60. Nested Conditions

Learn to place one if statement inside another. See how indentation links each else to its if, when to flatten with and, and how to keep nesting shallow.

Beginner25 min

61. Match-Case Statement

Meet the match-case statement added in Python 3.10. Learn value patterns, the wildcard, alternatives with |, guards, and matching sequences and dictionaries.

Intermediate25 min

62. Introduction to Loops

Learn why programs need loops, what repetition looks like without them, and how Python's two loop types, for and while, let you repeat work safely.

Beginner25 min

63. for Loop

Learn how the for loop visits each item of a list, string, tuple, dictionary or range, and how to use enumerate, zip, nested loops and loop else.

Beginner30 min

64. while Loop

Learn how the while loop repeats code while a condition is true, how to avoid infinite loops, and how to use sentinel values, break, continue and else.

Beginner30 min

65. range() Function

Learn how range() creates a sequence of numbers with start, stop and step, how to count up and down, and how to use it with for loops and list indexes.

Beginner25 min

66. break Statement

Learn how the break statement ends a loop early, how it works in for and while loops, and how it behaves inside nested loops and with the loop else clause.

Beginner20 min

67. continue Statement

Learn how the continue statement skips the rest of the current loop iteration, how it differs from break, and how to use it to filter values and keep loop code flat.

Beginner20 min

68. pass Statement

Learn what the pass statement is, why Python needs an empty placeholder, and how to use it in if blocks, loops, functions and classes while you build a program step by step.

Beginner15 min

69. Nested Loops

Learn how to place one loop inside another, trace how the inner and outer loops run together, and use nested loops to print patterns, tables and grids.

Beginner25 min

70. Loop Else

Learn the else clause on for and while loops: it runs only when the loop finishes without hitting break. Use it for clean search patterns without extra flag variables.

Intermediate25 min

Take the module test