CodeLab Academy 📞 9936 6696
← Lessons 🧩 Scratch for Beginners

Variables

## What is a variable? A variable is a **box with a name**. It stores a number or a word. Examples: a game's **score**, **lives** or **speed**. ## Making a variable **Variables** → **Make a Variable** → give it a name (for example `score`). ## Main blocks - `set [score v] to (0)` — sets the value to 0 - `change [score v] by (1)` — adds 1 to the value - `(score)` — uses the value inside another block ## Example ``` when green flag clicked set [score v] to (0) change [score v] by (5) say (score) ``` The cat says **5**.
← Previous Next →

💡 Want to track which lessons you've read and solve problems for points? Sign up for free or log in.