6. Repeating Things With Loops

  1. 6.1. Iteration
    1. 6.1.1. Don’t Repeat Yourself
  2. 6.2. for Loops
    1. 6.2.1. for Loop Syntax
      1. 6.2.1.1. Line By Line
      2. 6.2.1.2. Begin Counting at 0
    2. 6.2.2. Check Your Understanding
  3. 6.3. More on range
    1. 6.3.1. Set Start and End Values
    2. 6.3.2. Set a Step Value
    3. 6.3.3. Try It!
    4. 6.3.4. Use Variables in range
    5. 6.3.5. Use Expressions in range
    6. 6.3.6. Check Your Understanding
  4. 6.4. Iteration Improves the Turtle Program
    1. 6.4.1. How About Drawing Other Shapes?
      1. 6.4.1.1. Now Add Variables!
  5. 6.5. Loop Through a String
    1. 6.5.1. Characters Instead of Integers
    2. 6.5.2. Characters Another Way
    3. 6.5.3. Check Your Understanding
  6. 6.6. Loops With Conditions
    1. 6.6.1. Repeating a Check
    2. 6.6.2. Looping if
  7. 6.7. The Accumulator Pattern
    1. 6.7.1. Keeping a Running Total
      1. 6.7.1.1. Adding 1...num
      2. 6.7.1.2. Building a String
    2. 6.7.2. Reversing a String
    3. 6.7.3. Decreasing Total
    4. 6.7.4. Check Your Understanding
  8. 6.8. while Loops
    1. 6.8.1. while Loop Syntax
    2. 6.8.2. Control Flow
    3. 6.8.3. for Loops Rewritten as while Loops
      1. 6.8.3.1. Try It!
    4. 6.8.4. Input Validation
    5. 6.8.5. Which Loop To Use?
      1. 6.8.5.1. for Pros and Cons
      2. 6.8.5.2. while Pros and Cons
    6. 6.8.6. Check Your Understanding
  9. 6.9. Infinite Loops
    1. 6.9.1. Coding Infinity
    2. 6.9.2. Fun Fact
    3. 6.9.3. Check Your Understanding
  10. 6.10. Ending a Loop With break
  11. 6.11. Exercises: Loops
    1. 6.11.1. for Practice
      1. 6.11.1.1. Bonus
    2. 6.11.2. while Practice
    3. 6.11.3. The Accumulator Pattern
    4. 6.11.4. Challenge
  12. 6.12. Project: Turtle Loops
    1. 6.12.1. Part A - Polygons and Sprites
    2. 6.12.2. Part B - Clock Face
    3. 6.12.3. Part C - Nested Loops
    4. 6.12.4. Part D - Polygons With Sprites
    5. 6.12.5. Part E - Draw Something New