Variables

A temporary storage location for data such as a numerical value or a series of characters, and the values stored in that location vary depending on the commands given by the program.


The example above uses variables as temporary storage locations for user defined and calculated values in a program that creates the line from a given slope and y-intercept. Having students create and alter code of this nature corresponds with Mathematics Grade 9 C2.1, 2.2, 2.3, C3, C4.

Try it now!

To practice with variables, access our Scratch Playground here ⤵️