Page 133 - TGPT_V5.0_C5_Flipbook
P. 133
21 st
Double Tap Century #Critical Thinking
Skills
Answer the following questions:
1. Which block is used to make the sprite ask question?
2. Which block will you use if you want to combine two or more relational operators to
produce a single true/false result?
3. Which block allows you to do arithmetic calculation?
4. Which block allows you to compare the relationship between two values or variables?
VARIABLES
A program is a group of commands and instructions that tell the computer to carry out a
task. In scratch, a program is called a script. A script is made up of a number of blocks. So, the
blocks are the commands or instructions that we give to the sprite to perform a task.
All the numbers, text, date or pictures that we use in a program are called data. We store this
data in the computer memory so that we can get information from it later. This data is stored
in variables. It is called variable because it does not have a fixed value, its value changes. For
example, in the move block, the variable has a value 10 by default. You can modify this value
according to your script. Variables can store numbers as well as letters.
Creating Variables in Scratch
To create variables in Scratch, follow the given 2 Click on Make a
steps: Variable block.
Click on For this sprite only if you want this
variable to appear for the selected sprite only.
Here, we have added the variable fruit. It will
be available for all the sprites.
1 Click on Variables
block category.
Conditional Blocks in Scratch 131

