Save $588 per year with Sponsored Premium 

Variable

Variables are storage space that allow you to store numbers. You can define them in any name you wish. For example you can call it myvar1, meaning this is my variable number 1. Give it a meaningful name so that when you use it later on, you will remember what it is. Later on, you may use that variable for calling on it. To call on it, simply type it out in an equation.

So here I defined a new variable called my myvarsum = myvar1+ myvar2.

So now I have a third variable called myvarsun which stores the value of myvar1+ myvar2, which is 25+35=60.

 

If you change myvar1 and myvar2, the next time this code runs, myvarsum will change.

Sometimes, variables are used to store conditional results. And conditional results can result in 1 or 0. 1 meaning the condition is true and 0 means the condition is false. We will talk about this later in the conditional section

 

show less