Test yourself on Data Types with exam style questions, marked instantly.
Flashcards that come back just before you would forget them.
A revision plan that remembers what you know and shows what to do next.
See which topics you have nailed and which need another look.
Quiz yourself on Data TypesGet your flashcardsBuild my revision planTrack my progressVideo Lesson
Craig'n'Dave: Data TypesDifferent Kinds of Data
Just as you wouldn't store milk in a paper bag, computers store different kinds of data differently. An integer is a whole number (like counting apples: 1, 2, 3). A real/float has decimal places (like money: £19.99). A string is text (like a name: "Alice"). A boolean is true/false (like a light switch: on or off). A character is a single letter ('A'). Choosing the right type matters!
Data Types Reference
Real is the word used in exams. Many languages, including Python, call the same type float. The figure does not show how much memory each type uses, because the size depends on the programming language.
GCSE Data Types
| Data Type | Description | Examples |
|---|---|---|
| Integer | Whole numbers (positive or negative) | -5, 0, 42, 1000 |
| Real / Float | Numbers with decimal places | 3.14, -0.5, 19.99 |
| String | Text (sequence of characters) | "Hello", "123", "A" |
| Character | Single letter, digit, or symbol (the quote style does not decide the type) | 'A', '7', '?' |
| Boolean | True or False only | true, false |
Deep Dive: Type Casting
Converting between types (Python syntax):
int("42")→ 42 (string to integer)str(42)→ "42" (integer to string)float("3.14")→ 3.14 (string to real)int(3.9)→ 3 (real to integer, truncates)
Why cast? You can't add "5" + 3 (string + integer). You need: int("5") + 3 = 8
Memory Trick
Integer = It's whole (no decimals)
Real = Round the point (has decimal point)
String = Sentences and text
Boolean = Binary choice (true/false)
Exam Tips
- Know the difference: "42" is a string, 42 is an integer
- Character vs string: a character is one symbol; a string is a sequence of characters (it can have length 1). In Python, both "A" and 'A' are strings.
- Memory: Real numbers usually need more memory than integers. The exact size depends on the language.
Make this stick
Signing in gives access to all PrepWise features.