Jan 26, 2026
# Chapter 3 — Variables, Types, and “What Is Stored Where”
This chapter uses a “label and box” model.
## 3.1 Variables Are Labels (Not Boxes)
```python
a = 10
b = a
a = 99
print(a, b)
```
Output:
```text
99 10
```
Why? Because `b` got the value of `a` at that moment. Reassigning `a` does not “reach back” and change `b`.
### Diagram: Label → Value
```text
Before a = 99:
a ---> 10
b ---> 10
After a = 99:
a ---> 99
b ---> 10
```
## 3.2 Core Types You Must Know
| Type | Example | Used for |
|------|---------|----------|
| int | `42` | counting, indexing |
| float | `3.14` | measurements, averages |
| bool | `True` | conditions |
| str | `"meetcode"` | text |
| None | `None` | “no value yet” |
## 3.3 Quick Type Checking
```python
x = 3.5
print(type(x))
```
---