Python Foundations · Unit 2

Unit 2: Control Flow

Make decisions with if statements and repeat work with loops.

  • 2–3 hrs
  • Beginner
  • 11 lessons

Lessons

  1. Understanding Control FlowWhat control flow means, sequential execution, conditional execution, repetition 10–15 min
  2. Comparison & Logical OperatorsComparison operators, boolean results, logical operators, complex conditions 15–20 min
  3. The if StatementWhat an if statement is, how to write if statements, when code runs, proper indentation 15–20 min
  4. if-else and elifThe else clause, the elif clause, when each block runs, practical examples 15–20 min
  5. Nested ConditionalsWhat nested conditionals are, why nesting is useful, how indentation works 20–25 min
  6. Boolean Logic in PracticeCombining operators, real-world examples, simplifying conditions, common patterns 20–25 min
  7. Introduction to LoopsWhat loops are, why loops are useful, types of loops, when to use loops 15–20 min
  8. The while LoopWhat a while loop is, how while loops work, using counters, preventing infinite loops 20–25 min
  9. The for LoopWhat a for loop is, using range(), iterating through strings, iterating through lists 20–25 min
  10. Loop Control StatementsWhat break does, what continue does, what pass does, when to use each 20–25 min
  11. Practical Control Flow ExamplesCombining concepts, building real programs, problem-solving approach 30–40 min
  12. End of unit test

    Ten multiple choice questions worth 7 points each and one free response problem worth 30, so 100 in total. Score 70 or more to finish Unit 2 and unlock Unit 3.

    Take the Unit 2 test