Introducing variables
When you write programs you often need to give the computer information to work on. The computer stores this information in spaces called variables in its memory.

The spaces in the computer's memory are rather like the empty boxes in this picture. When you give the computer a piece of information you have to give it a label too. The computer puts information in a space and labels it. A labelled space is called a variable.
Type in the following line:
N=999
The letter N is the label for the variable, and 999 is the value to
be stored in a variable labelled N.
You might sometimes see this written LET N=999. You can leave out the LET on this computer.
Now let’s PRINT out the value in the variable N:
PRINT N
You will see the number 999 printed out.
Try changing the value stored in N by typing the first line again, but
this time with a different number, and then PRINT it out again.
Strings
In BASIC, words, letters and symbols are called strings. When you store a string in a variable, you must type the string in quotes. A variable that contains a string is called a string variable. Its label always has a dollar sign at the end.
U$="UGLY MONSTER" R$="RUBBISH" S$="/&SILLY SYMBOLS!!"
String variable labels always end with a $. Variables that don’t
end with a $, like N above, are numeric variables. They
store numbers such as 42 or even 3.14.
Using PRINT with variables
To make the computer display the information stored in a
variable, you use PRINT followed by the variable name.
Try running the program below to see how this works.
NEW 10 CLS 20 N=99 30 B$="BANANAS" 40 PRINT N 50 PRINT B$ RUN
Naming variables
It's a good idea to give a variable a name that will help you remember what it contains.

Letters of the alphabet and words are usually used as names for variables. You can also use numbers, as long as the variable name starts with a letter.
So rather than the single letter variable names we used above, it is easier to understand if we use longer names like:
NEW 10 CLS 20 QUANTITY=99 30 FRUIT$="BANANAS" 40 PRINT QUANTITY; FRUIT$ RUN