← Back to All Modules
Module 2Beginner
Control Flow & Logic
Make programs that think and decide. Master conditionals, loops, and logical operations.
3-4 hours
5 Lessons
8 Exercises
🎯 Learning Objectives
By completing this module, you will:
- Make decisions with if/elif/else statements
- Compare values using comparison operators
- Combine conditions with logical operators
- Repeat actions with for and while loops
- Control loop execution with break and continue
- Handle nested loops and complex conditions
- Write cleaner code with better logic
📖 Lessons
Lesson 1: Boolean Logic and Comparisons
30 min- •Comparison operators
- •Logical operators
- •Truthy and falsy values
- •Boolean expressions
Lesson 2: If Statements
30 min- •Basic if statements
- •if-else structure
- •if-elif-else chains
- •Nested if statements
- •Ternary operator
Lesson 3: While Loops
30 min- •While loop basics
- •Loop conditions
- •Avoiding infinite loops
- •Input validation
- •break and continue
Lesson 4: For Loops
45 min- •For loop syntax
- •range() function
- •Looping through sequences
- •Nested loops
- •Loop patterns
Lesson 5: Loop Control
30 min- •break statement
- •continue statement
- •pass statement
- •else clause with loops
- •Common patterns
📚 Module Resources
🚀 End-of-Module Project
Number Guessing Game & Password Validator
Build an interactive game with hints and a security-focused password checker.
Features you'll build:
- ✓Random number generation
- ✓Score tracking
- ✓Password security checks
- ✓User feedback