Coding worksheet · Coding
Trace the repeat blocks: what does Olly say? (practice) · Grade 4
Read 6 short block code programs about repeat loops that add up and work out by hand what each one prints or the final value of a variable. Builds careful code tracing.
- Grade 4 · ages 9 to 10
- Medium
- 15 to 20 minutes
- 1 page
- Free
The answer key is a separate page for grown-ups. Sign in to download it.
The programs to trace
Directions: Read each program from top to bottom, one block at a time. Keep track of every box (variable) as it changes, then write the answer.
- 1 What does Olly say?
- repeat 2 times say "big"
- say "small"
- 2 How many pebbles at the end?
- set pebbles to 2 repeat 3 times set pebbles to pebbles * 2 pebbles =
- 3 What does Olly say?
- set jumps to 0 set cookies to 18 repeat 4 times change jumps by 3 change cookies by -3 say jumps, cookies
- 4 How many points at the end?
- set points to 3 repeat 3 times change points by 6 points =
- 5 What does Olly say?
- set total to 0 for each n in [5, 4, 7] change total by n say total
- 6 What does Olly say?
- set total to 0 set n to 2 repeat 4 times change total by n change n by 2 say total
What your child practices
Your child builds careful code tracing. The skill is “Loops”: use repetition to shorten programs.
- Grades and ages
- Grade 4, ages 9 to 10
- Time
- About 15 to 20 minutes
- Subject
- Coding
- Level
- Medium for Grade 4
- Answer key
- Yes, for grown-ups who sign in
- Printing
- 1 page, US Letter or A4, low-ink option
- Updated
How to use it
Work through the first program together, one line or arrow at a time. Then let your child work through the rest, showing their thinking on the page. It is pitched at the expected level for Grade 4, for practice after the skill has been taught.
An answer key comes with it as a separate page that grown-ups download after signing in.
Tip for grown-ups: Have your child write each variable's value beside its line as they trace.
Done on paper? A grown-up can record it on the child's page in PlayOwl; downloading alone doesn't count as finished.
Printable generator
Make your own printables
Make brand-new sheets like this one, with answer keys, using the printable generator that comes with a PlayOwl plan. This sheet stays free.