Variable
Also known as: named storage
A named container in a program that stores a value, which can be read, updated, or replaced. Programs work with data by storing and updating it in variables—without them nothing persists.
💡 Intuition
A labeled box you can put things in, take things out, or change what's inside.
Core Idea
Variables give meaningful names to data values so programs can store, retrieve, and modify them.
🔬 Example
🎯 Why It Matters
Programs work with data by storing and updating it in variables—without them nothing persists.
⚠️ Common Confusion
= means 'assign' not 'equals'. x = x + 1 is valid (not a paradox).
Related Concepts
Next Steps
How Variable Connects to Other Ideas
Once you have a solid grasp of variable, you can move on to data types and assignment.
Learn More
Go Deeper
Frequently Asked Questions
What is Variable in CS Thinking?
A named container in a program that stores a value, which can be read, updated, or replaced.
Why is Variable important?
Programs work with data by storing and updating it in variables—without them nothing persists.
What do students usually get wrong about Variable?
= means 'assign' not 'equals'. x = x + 1 is valid (not a paradox).