Programming Primitive Data Types (Edexcel GCSE Computer Science)

Revision Note

James Woodhouse

Expertise

Computer Science

Programming Primitive Data Types

  • Section 1 covers the basics of different data types

  • The exam requires students to be able to write programs that make use of all primitive data types

  • To recap, the main data types are:

    • Integer

    • Real

    • Boolean

    • Character

Programming integers

  • An integer is a whole number (negative or positive)

  • An example of an integer is 5

    • number = 5

    • numberOne = int(input("Enter a number"))

Programming reals

  • A real (also known as a float) is a decimal number

  • An example of a real is 3.4

    • realNumber = 3.4

    • price = float(input("Enter a number"))

Programming Boolean

  • A Boolean (also known as a bool) can be either True or False

  • An example of a bool is True

    • lightSensor = bool()

    • lightSensor = True

Programming characters

  • A character (also known as a char) is a single letter, number or symbol

  • An example of an character is "a"

    • firstNameInitial = str()

    • firstNameInitial = "a"

You've read 0 of your 0 free revision notes

Get unlimited access

to absolutely everything:

  • Downloadable PDFs
  • Unlimited Revision Notes
  • Topic Questions
  • Past Papers
  • Model Answers
  • Videos (Maths and Science)

Join the 100,000+ Students that ❤️ Save My Exams

the (exam) results speak for themselves:

Did this page help you?

James Woodhouse

Author: James Woodhouse

James graduated from the University of Sunderland with a degree in ICT and Computing education. He has over 14 years of experience both teaching and leading in Computer Science, specialising in teaching GCSE and A-level. James has held various leadership roles, including Head of Computer Science and coordinator positions for Key Stage 3 and Key Stage 4. James has a keen interest in networking security and technologies aimed at preventing security breaches.