Coding worksheet · Coding
If-then blocks: what does Olly say? · Grade 2
Read 5 short block code programs about if-then-else choices 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
- Easy
- 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?
- set cookies to 9 if cookies > 8 then say "big"
- else say "small"
- 2 How many kites at the end?
- set kites to 5 if kites > 7 then change kites by 3 else change kites by 4
- kites =
- 3 What does Olly say?
- set seeds to 9 if seeds > 8 then say "fast"
- else say "slow"
- 4 How many seeds at the end?
- set seeds to 3 if seeds > 4 then change seeds by 2 else change seeds by 3
- seeds =
What your child practices
Your child builds careful code tracing. The skill is “Conditions”: use if/else to respond to situations.
- Grades and ages
- Grade 2, ages 7 to 8
- Time
- About 15 to 20 minutes
- Subject
- Coding
- Level
- Easy 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 one of the easier sheets for Grade 2, 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.