Revise Computingrevisecomputing.co.uk
At a glanceFeaturesStudentsPricingHow it worksFree GCSE notesExam dates
At a glanceFeaturesStudentsPricingHow it worksFree GCSE notesExam dates

Knowledge organisers / Data Types

The use of data types

All topicsPractise exam questions
Knowledge organiser

Data Types

2.2.2a

Integer, Real/Float, Boolean, Character and String

What you need to know

A data type defines what kind of data a variable can hold and what operations can be performed on it. The five main data types are integer (whole numbers), real/float (decimals), Boolean (True/False), character (a single symbol), and string (a sequence of characters). Choosing the correct data type ensures efficient storage and correct processing.

Key points

  • Definition:Data Type: a classification that defines what kind of data a variable can store and what operations can be performed on it.
  • Integer (int): whole numbers with no decimal point, e.g. 5, -20, 0. Use for counts, year groups, DoorActiveTime = 100.
  • Definition:Real / Float: a number with a decimal/fractional part, e.g. 3.14, -0.5. Use for measurements like javelinThrow = 18.2.
  • Boolean (bool): only TWO possible values, True or False; used for conditions, logic, and flags (e.g. DoorSensorActive, SystemArmed).
  • Character (char): a single letter, digit, or symbol, e.g. 'A', '5', '#'. NOT acceptable when the question expects String.
  • String (str): a sequence of characters, e.g. "Hello", "Super-Team", "+449999999999". Use for names, text, identifiers, phone numbers.
  • Data types determine which operations are valid: you cannot divide a string, for example.
  • 123 as an integer and "123" as a string are different; they are stored and used differently.
  • Exam Tip:When asked to identify data types, each must be DIFFERENT — don't reuse one. Match data to context: teamName → String, yearGroup → Integer, javelinThrow → Real/Float.
  • Exam Tip:Boolean can ONLY have two values (True/False). If there are 3+ options (win/loss/draw), Boolean is NOT suitable — use String or Integer.
  • Exam Tip:Phone numbers like +449999999999 should be stored as STRING (not Integer) because of the + prefix and leading zeros.
  • Exam Tip:EmergencyPhoneNumber → String, UserName → String, DoorSensorActive → Boolean, DoorActiveTime → Integer.

Code examples

Data types in Python
python
age = 16           # Integer
height = 1.75      # Float (real)
passed = True      # Boolean
grade = "A"        # String
initial = "J"      # String (Python has no char type)

print(type(age))    # <class 'int'>
print(type(height)) # <class 'float'>
print(type(passed)) # <class 'bool'>