Variables

Declaring a variable

A variable is like a container used to hold something. Variables store certain values. When making a variable you give it a name and possibly an intial value. This is called declaring a variable.

Example 1

x = 3

Here the variable(x) is declared and initialized with the value three(3).


Changing a variable

A variable's value will often need to be changed throughout the program. Updating a variable's value is exactly the same as declaring and initializing it.

Example 2

x = 5

The variable(x) is now updated with the value of five(5)