What is a Variable?
Imagine a variable as a labelled storage box. You give the box a name (like Score), and you can put any value inside it โ a number, some text, or even the result of a calculation. Your Scratch project can peek inside the box at any time, change what's stored, or display the value on the stage.
Real-world analogy
Name
Every variable has a unique name so you can refer to it later (e.g. Score, Lives, PlayerName).
Value
The data stored inside โ a number like 0, 100, or -5, or text like 'Alice'.
Changes over time
Unlike a fixed number, a variable's value can be updated as many times as needed while the program runs.
Visible on stage
Scratch can display the variable's current value in a monitor box on the stage so players can see it.
Key vocabulary
- Declare โ to create (or "make") a variable for the first time.
- Assign โ to put a value into a variable using "Set".
- Increment โ to increase a value (usually by 1) using "Change by".
- Read โ to use the current value stored in a variable.