Programming Primitive Data Types (Edexcel GCSE Computer Science)

Revision Note

James Woodhouse

Written by: James Woodhouse

Reviewed by: Lucy Kirkham

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"

Last updated:

You've read 0 of your 5 free revision notes this week

Sign up now. It’s free!

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

Expertise: Computer Science

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.

Lucy Kirkham

Author: Lucy Kirkham

Expertise: Head of STEM

Lucy has been a passionate Maths teacher for over 12 years, teaching maths across the UK and abroad helping to engage, interest and develop confidence in the subject at all levels.Working as a Head of Department and then Director of Maths, Lucy has advised schools and academy trusts in both Scotland and the East Midlands, where her role was to support and coach teachers to improve Maths teaching for all.