Control Flow
Learning Path
Hands-on Labs
Each objective has a coding lab that opens in VS Code in your browser
Make decisions with if/elif/else
You will control program flow with conditional statements. Write simple if statements, handle multiple conditions with elif, and nest if statements for complex logic.
Iterate with for loops
You will iterate over sequences with for loops. Loop through ranges of numbers, iterate over strings character by character, and use enumerate to get both index and value.
Repeat with while loops
You will use while loops for conditional repetition. Create countdown loops, loop until a condition is met, and learn to avoid infinite loops with proper exit conditions.
Control loop execution
You will control loop execution with break and continue. Use break to exit loops early when a condition is met, use continue to skip specific iterations, and combine these with conditionals.