What is a data type?
A data type tells the computer what kind of value a variable holds — so it knows how much memory to allocate and what operations make sense on it.
You need to know five types for AQA:
| Data type | What it holds | Example |
|---|---|---|
| Integer | Whole number | `42`, `-7`, `0` |
| Real / Float | Decimal number | `3.14`, `-0.5`, `20.0` |
| Char | Single character | `'A'`, `'!'`, `' '` |
| String | Zero or more characters | `"hello"`, `"07700"` |
| Boolean | True or False only | `True`, `False` |
Memory sizes: integer ≈ 2 bytes, real ≈ 4 bytes, char = 1 byte, string = 1 byte per character, Boolean = 1 byte.
Phone numbers, postcodes and sort codes must be stored as **strings** even though they look like numbers — storing `07700900123` as an integer drops the leading zero.