Revise Computing
Revision notesQuestionsFor schools
Log inStart revising free
Revision notesQuestionsFor schoolsLog in
GCSE Computer Science/Supplementary programming practice/Data Types and Casting

Common data types

301.4 Data Types and Casting

Practise exam questions

Data Types and Casting — Note 1 of 4

int, real, bool, char, string.

What you need to know

Every value in Python has a data type. The most common are int (whole numbers), float (decimals), str (text), and bool (True/False). Use type() to check.

What to know

  • int: whole numbers like 5, -3
  • float: decimals like 3.14, -0.5
  • str: text in quotes like "hello"
  • bool: True or False
  • type() returns the data type of a value

Code examples

Data types
python
age = 15          # int
price = 9.99      # float
name = "Alice"    # str
passed = True     # bool
print(type(age))  # <class 'int'>
← Previous topicNaming conventions301.3 Variables and ConstantsNext note →Choosing types301.4 Data Types and Casting

Back to Data Types and Casting

Specification notes for programming are in Paper 2.

Data Types and Casting

Note 1 of 4

  1. 1Common data types
  2. 2Choosing types
  3. 3Casting
  4. 4Fix type errors
Topic overview

© 2026 Revise Computing · revisecomputing.co.uk

Privacy noticeTermsContact

Revise Computing is an independent revision resource. It is not affiliated with, or endorsed by, OCR (Oxford Cambridge and RSA Examinations).