A number variable is like a special box that holds numbers. Just like text variables hold words, number variables store numeric values such as your age, height, or how many points you have in a game.
Creating a Number Variable
In Scratch, click on the “variables” section on the left.
Then, click “Make a Variable” and select “For all sprites.”.
Name the variable something like “Age”, “score,” or “points.”.
Naming a Number Variable
You can give your number variable any name that tells you what it stores. For example:
“Age” stores how old you are.
“Points” stores how many points you earned.
“Height” stores your height in meters or centimeters.
Deleting a Number Variable
If you no longer need a number variable, right-click on the variable’s name in the “Variables” section and choose “Delete Variable”.
Store User Input into a Number Variable
To store a number, you’ll use the “Set [variable] to []” block in Variables.
For example, if you’re asking someone’s age, you can store the response in the age variable.
Output the Value of a Number Variable
To show the value of the number, you can use the “Say [] for [] seconds” block, or you can use the “Show Variable [Variable]” block to show the variable’s value on the screen.
Starting with Age Variables
After Adding Height Variable
After adding Score variable
After adding Time variable
You can also watch this video Number Variables
The Join operator in Scratch is used to combine (join) two pieces of text together to create one longer string. It’s like putting two words or sentences together to make a new one!
1️⃣ Go to the Operators section.
2️⃣ Drag the Join block onto the script area.
3️⃣ Insert Text into the two parts of the block.
4️⃣ You can use variables or simple words!
Then now drag the say hello block from the Looks and replace “hello” with the join