Coding worksheet · Coding
Block code: what is in each box? (warm-up) · Grades 4–5
Read 5 short block code programs about variables that change step by step and work out by hand what each one prints or the final value of a variable. Builds careful code tracing.
- Grades 4–5 · ages 9 to 11
- Easy
- 10 to 15 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?
- set red to 4 set blue to 5 set red to blue set blue to red say red, blue
- 2 What does Olly say?
- set cookies to 0 set pebbles to 17 repeat 3 times change cookies by 2 change pebbles by -3 say cookies, pebbles
- 3 How many cookies at the end?
- set cookies to 5 change cookies by 2 set cookies to cookies * 2 change cookies by -2 change cookies by 8 cookies =
- 4 What does Olly say?
- set apples to 2 set jumps to apples change apples by 3 say apples
- 5 What is big at the end?
- set a to 4 set b to 10 if a > b then set big to a else set big to b set big to big * 2 big =
What your child practices
Your child builds careful code tracing. The skill is “Variables”: use named values such as a score, lives or a timer that a program changes and checks.
- Grades and ages
- Grades 4–5, ages 9 to 11
- Time
- About 10 to 15 minutes
- Subject
- Coding
- Level
- Easy for Grades 4–5
- 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 one of the easier sheets for Grades 4–5, good as a warm-up or a first look at the skill.
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.