Skip to content
Your progress

Checking your sign-in…

Who's learning?

Each profile keeps its own read lessons, badges, streak, and practice scores on this device.

Lesson 1 of 8

A box with a name on it

Show on a big screen

4 min

Text size

A game must count mangoes. It needs a place to keep the number.

An empty box. No name yet.
Step 1 of 4
  1. An empty box. No name yet.
  2. Name it score.
  3. Set score to 5. That puts 5 in the box.
  4. Set score to 9. The 5 is gone.

A variable is a named box. It holds a value. In this track, values are numbers.

You pick the name: score, lives, mangoes. Blocks use the name to find the box. Lives are the chances a player has left. The computer does not know what the name means.

Rule: A variable is a named box. It holds one value at a time. Setting it replaces what was there.

Make score hold 5 and lives hold 2. Tap the buttons in any order.

Loading lab…

Try the lab to finish this lesson.