Page 86 - TP_Prime_v2.2_Class_5
P. 86
A variable that stores letters in the form of strings or characters is called string
variable. A string variable can store names, words, sentences, numbers, and enclosed in
quotation marks. For example, “Kavita”, “I am 12 years old”, “12345”. These variables
are not used in calculations.
Now I know about the script and variables. Can I also create my own
variable?
Prime (Ver. 2.2)-V Yes, you can create your variable. Let me tell you how.
Creating Variables in Scratch
To create variables in Scratch, follow the given steps:
Step 1: Click on Variables block category. A set of blocks appears in the block
84 palette.
Step 2: Click on Make a Variable button. A New Variable dialog box appears. Type
a variable name in the New variable name box.
Step 3: Click on the radio button of either of the options. Click on For all sprites
if you want this variable to appear for all the sprites.
Or
Click on For this sprite only if you want this variable to appear for a single
sprite only.
Here we have added the variable fruit. It will be available for all the sprites.
Step 4: Click Ok button.
2
1 3
4

