AQA A-Level Computer Science · Section 4.1 Fundamentals of Programming
| Data Type | Description | Example | AQA Keyword |
|---|---|---|---|
| Integer | Whole number (positive or negative) | 42, -7, 0 | INTEGER |
| Real | Number with decimal point | 3.14, -0.5 | REAL |
| Boolean | True or False only | True, False | BOOLEAN |
| Character | Single character | 'A', '5', '!' | CHARACTER |
| String | Sequence of characters | "Hello World" | STRING |
Type casting converts a value from one data type to another.
| Function | Converts to | AQA Pseudocode | Python |
|---|---|---|---|
| INT(x) | Integer | INT("42") → 42 | int("42") |
| REAL(x) | Real | REAL(5) → 5.0 | float(5) |
| STR(x) | String | STR(42) → "42" | str(42) |
| BOOL(x) | Boolean | BOOL(1) → True | bool(1) |