Knowledge Organiser: Data Types
This topic summary covers Knowledge Organiser: Data Types within Data Types for GCSE Computer Science. Revise Data Types in Programming for GCSE Computer Science with 15 exam-style questions and 10 flashcards. This topic appears less often, but it can still be a useful differentiator on mixed-topic papers. It is section 9 of 9 in this topic. Use this topic summary to connect the idea to the wider topic before moving on to questions and flashcards.
Topic position
Section 9 of 9
Practice
15 questions
Recall
10 flashcards
Knowledge Organiser: Data Types
Key Terms
- Integer: A whole number, positive or negative, with no decimal point (e.g. -5, 0, 42)
- Real / Float: A number with a decimal point (e.g. 3.14, 19.99)
- String: A sequence of characters enclosed in quotes (e.g. "Hello")
- Character: A single letter, digit, or symbol enclosed in apostrophes (e.g. 'A')
- Boolean: A value that is either true or false only
- Type casting: Converting a value from one data type to another
Must-Know Facts
- "42" (string) and 42 (integer) are different — you cannot add them without casting
- 'A' (one character) and "A" (string of length 1) are different types
- Real/float uses more memory than integer
- Booleans are used in conditions:
if loggedIn == true then - Type casting:
int("42")converts string to integer;str(42)converts integer to string int(3.9)truncates to 3 — it does NOT round
Key Concepts
- Choose integer for counting whole items; real for measurements or money
- Use string for names, addresses, passwords — any text
- Boolean used in selection and iteration conditions
- Cast before arithmetic:
int(userInput) + 5notuserInput + 5
Common Mistakes
- Not casting user input before arithmetic: User input is always a string — you must cast to integer or real before doing maths:
int(input("Age: ")) - Confusing integer and real: Integer stores whole numbers only; real/float stores decimal values — using integer for money (e.g. 4.99) will truncate the decimal part
- Thinking int() rounds a decimal:
int(3.9)gives 3, not 4 — integer casting truncates (removes the decimal) rather than rounding - Confusing character and string: A character is a single symbol (one letter or digit); a string is a sequence of characters — they are different data types
- Using a string to store a number you will calculate with: "42" stored as a string cannot be used in arithmetic — always use integer or real for values you need to calculate with
Revise this topic interactively on PrepWise — self-test mode, tap-to-reveal definitions, and Common Mistakes from examiners.
Try the interactive Knowledge Organiser — free →