OCR GCSE Computer Science (J277)Specification point 2.2.2

OCR J277 2.2.2: Data types

The free BugBot lessons that teach this point, a robot to try it on, and the past-paper questions that test it.

What it covers

The last lesson ended with a robot that would not drive "20" centimetres, and a program that thought "20" times 3 was 202020. Both come from the same idea: every value in Python has a data type, and the type decides what you can do with it.

  • Five types
  • Why the type matters
  • Casting: changing the type
  • When casting fails
Read the free lesson (15 min)

Or do it in the simulator, with tasks that mark themselves

Lessons that teach it

  1. F1.8 Data types and casting Programming basics
    Integer, real, Boolean, character and string, and converting between them.
  2. F3.2 Character codes and conversion Strings, lists and records
    ord and chr, ASCII, comparing strings, and a Caesar cipher.

Try it on a robot

The task from F1.8 Data types and casting, running here. Change the program and press Run.

Past paper questions on this

Real exam questions that test this, each worked through with a program you can run.

The specification is OCR's own document; this page says which of our lessons teach point 2.2.2 and is not endorsed by the board.