Variables & Data Types
📋 What it is
A variable is a named box that stores a value; data types (number, text, true/false) say what kind it holds.
🗣️ Coach says
A VARIABLE is a labelled box that holds a value your program can use and change — like "score = 0", then later "score = 10". The kind of thing it holds is its DATA TYPE: a number, some text (a "string"), or a true/false ("boolean"). Naming and using variables well keeps code clear.
🧠 Memory hook
A variable = a named box for a value. Its data type says what kind (number/text/true-false).
😂 Giggle
What do you call a computer that sings?
A-Dell!
😲 Whoa!
A "boolean" data type — holding only true or false — is named after mathematician George Boole, who worked out the logic of true/false over 150 years before computers existed.
✅ Quick check: What is a variable in programming?
Say your answer out loud first — then reveal.
A named container (box) that stores a value the program can read and change — like a score or a name.
A variable holds a value under a name for later use.
🧪 Try it! (2 minutes)
Name three variables for a game (score, playerName, isAlive) and say each one's data type.