Programming Primitive Data Types (Edexcel GCSE Computer Science)
Revision Note
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!
Did this page help you?