Coding · Grade 6
Loops and Iteration
Learners use for loops with range(), build running totals and counts with accumulators, and trace while loops that stop when a condition becomes False, including spotting infinite loops. Robot puzzles with repeat blocks show how repetition shortens programs, and learners decide when a for or while loop fits a task.
- 4 lessons
- About 80 minutes
- Check what you learned: 8 questions
- Ways to answer: program with blocks, choose an answer, put code in order, trace code, type a number and true or false
What learners will discover
- Trace for loops that use range() with a start, a stop that is not included, and a step.
- Use counters and accumulators that start before a loop and update inside it.
- Trace while loops, explain how the condition makes them stop, and fix an infinite loop.
- Use repeat blocks to shorten programs and choose between for and while for a task.
Lessons
-
Repeating with for and range 6 steps3 practiceabout 20 min
-
Counters and accumulators 6 steps4 practiceabout 20 min
-
while loops 5 steps3 practiceabout 20 min
-
Choosing and using loops 5 steps2 practiceabout 18 min
-
Check what you learned 8 questions at the end
Keep exploring
Games to practice with
- Robot RoutesSnap together arrow, repeat and dance blocks to guide Bolt the robot home.
- Bug DetectiveA robot program almost works. Run it, spot the buggy block, and fix it.
- Sorting FactoryTurn a work order into if/else rules and watch the conveyor sort every item.
More 6th grade coding
- 6th Grade Coding Games5 games to play free
- 6th Grade Coding Worksheets10 printable worksheets
Guide for grown-ups
- How to start homeschooling: a step-by-step guide for familiesA guide for parents · 7 min read