Page 112 - 2502_Pakistan-kifayat_C-7
P. 112

The code for this task is as follows:





















              The output of the program is:

























                   VARIABLE


              Variable in Scratch is like a container that stores information such as numbers or text, which can
              change during the program. It allows you to remember values while your game or animation runs.
              Variable makes your projects interactive and responsive.
              Creating a Variable


              To create a variable, go to the Variables category and click “Make a Variable”. Give it a name like
              Score, Lives, or Time Left. You can choose whether it’s for all sprites or for this sprite only.





















                  110  Premium Edition-VII
   107   108   109   110   111   112   113   114   115   116   117