Skip to content
PlayOwl

Coding worksheet · Computers & Digital Literacy

Block code: what is in each box? · 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 How many cookies at the end?
  • set cookies to 3 repeat 3 times change cookies by 2
  • cookies =
  • 2 How many coins at the end?
  • set coins to 1 change coins by 3 change coins by -2 change coins by -1
  • coins =
  • 3 What does Olly say?
  • set kites to 6 set stars to kites change kites by 5 say stars
  • 4 What does Olly say?
  • set coins to 5 set shells to 1 set coins to coins + shells say coins
  • 5 How many acorns at the end?
  • set acorns to 1 repeat 3 times change acorns by 2
  • acorns =
  • 6 How many stars at the end?
  • set stars to 4 change stars by -1 change stars by 1
  • stars =

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
Computers & Digital Literacy
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.