There are five main data types that are used at GCSE, and as a part of your course (and later your exam) you will be expected to understand how they work and when it is most appropriate to use them. Creating practice programs on a regular basis is the best way to do this – although we are introducing data types this week, we will be referring back to each of these five types regularly throughout the course.
The definitions below will give you the basic knowledge needed to use these data types, but I strongly recommend that you complete the full Data Types section to give you more information and practical ways to apply your knowledge.
Char – a single character (symbol)
String – one or more characters, often forming a word or phrase
Integer – a whole number
Real – a decimal number (aka. a float)
Boolean – a special type that only holds either True or False
Try using the python below to test the data types of each piece of code (you can change & run the code directly on this webpage – to save any code that you change, either copy it into your own coding program or use the Repl “fork”):
Add to the discussion below – identify the different data types that we use everyday. Try to add an example that hasn’t been suggested yet.
I see data types everywhere! When we go shopping, the cost of products is shown as currency. Because this is a decimal number that makes it a Real / Float.
What data types do you see around you?