Skip to content
PlayOwl

Coding worksheet · Coding

Block code: what is in each box? (practice) · Grade 2

Read 6 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.

  • Grade 2 · ages 7 to 8
  • Medium
  • 20 to 30 minutes
  • 1 page
  • Free
Paper

The answer key is a separate page for grown-ups. Sign in to download it.

Make another one like this

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 apples to 4 set kites to apples change apples by 3 say apples
  • 2 How many pebbles at the end?
  • set pebbles to 3 repeat 2 times change pebbles by 3
  • pebbles =
  • 3 What does Olly say?
  • set jumps to 2 set gems to 2 set jumps to jumps + gems say jumps
  • 4 How many cookies at the end?
  • set cookies to 5 change cookies by -2 change cookies by -1
  • cookies =
  • 5 What does Olly say?
  • set gems to 8 set acorns to gems change gems by 2 say gems
  • 6 How many points at the end?
  • set points to 1 repeat 2 times change points by 3
  • points =

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
Grade 2, ages 7 to 8
Time
About 20 to 30 minutes
Subject
Coding
Level
Medium for Grade 2
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 2, 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.