Concept

What is a variable in programming?

A variable is a named box that holds a value — and unlike math class, that value can change. Below is a real widget from epochai's own curriculum, not a screenshot.

Think of a variable as a labeled box. The label is the name you chose — score, age, total — and the box holds whatever value you put in it. In Python, you create one just by writing score = 0: that line means "make a box named score, and put 0 inside it."

The part that trips people up is reassignment. Run score = score + 10 and the box doesn't grow a second value — the old one is replaced. The name stays fixed; what's inside it doesn't have to. That's the whole mental model: a variable is a name pointing at a value, and pointing it at a new value is all "changing a variable" ever means.

Every data structure you'll meet later — lists, dictionaries, objects — is a variation on this same idea: a named slot, holding something, that you can read or overwrite. Get this one down and the rest builds on top of it cleanly.

Watch it happen

The same interactive widget epochai's own lessons use — live, not a recording.

Playing automatically. Every epochai lesson also has an Explore mode where you drive it yourself.

This is one line out of 49 free lessons

Module 1 — Programming Fundamentals — covers variables, control flow, loops, functions, and debugging. Free, no card required.