Promptles
Programming Basics

Variable

beginner

Definition

A named container that holds a value in your program. Think of it like a labeled box: the label is the variable's name, and inside is the data (a number, some text, a list, etc.). You can read what's inside, replace it, or use it in calculations.

In the wild

let score = 0; creates a variable named 'score' that starts at zero. Later, score = score + 10; changes it to 10. The name 'score' is how you refer to that value throughout your code.

More from Programming Basics