How Logic Works

Variable

A named container that stores a value in a program.

Definition

A named container that stores a value in a program. You can create a variable, assign it a value, change that value, and use it in calculations or decisions. Variables are the basic building blocks of all programs.

Example

score = 0 creates a variable called score and sets it to zero. Later, score = score + 10 changes it to 10.

See it in context Learn how Variable fits into the bigger picture of how software actually works.

Read the Guide →