Learn the essential computer science fundamentals that power all modern software — including how code runs, what memory and CPU do, and how programming languages interact with machines. No prior experience needed. This course builds the mindset and foundation for programming, DSA, and interviews.
Variables are one of the most fundamental building blocks in programming. They act as named storage locations in memory that hold values used by your program. Understanding how variables work and how they map to memory is critical to writing efficient, bug-free code.
A variable is a label or name that refers to a value stored in computer memory. It allows you to store, access, and manipulate data in your program.
// Python name = "Alice" age = 25
When a variable is declared and assigned a value, the computer assigns a memory address to hold that value. The variable name acts as a reference to that memory address.
Variable Value Memory Address -------- ----- --------------- x 10 0x1001 y 20 0x1005 name "Ali" 0x1010
PI = 3.14)name ≠ Name)total_price not x1)Think of memory as a row of lockers. Each locker has a number (address), and you place a value (like a file or item) in it. The variable name is like labeling a key that tells you which locker contains your stuff.
# Python Example x = 42 print(id(x)) # prints memory address
id("hello") in Python?In the next chapter, we’ll learn how to plan logic in coding using Algorithms & Flowcharts.