Primitive data types, integer, real/floating point, character, string and Boolean
1.4.1 Data Types
Data Types — Note 1 of 10
Candidates need to have an understanding of programming data types such as integer, real, Boolean, character string etc. Candidates need to be able to choose appropriate data types for a situation or given data. Candidates should have experience of programming solutions using these data types. Candidates should have knowledge of how to convert from one data type to another.
A data type defines what kind of value a variable can hold and which operations can be carried out on it. You need to choose appropriate data types for given data and convert between them.
int("42"), str(3.5), float("2.1").Exam tipCommon mistake
A whole number, positive or negative, e.g. 42, -7.
A number with a fractional part, e.g. 3.14, -0.5.
A single letter, digit or symbol, e.g. 'A', '7', '#'.
A sequence of characters, e.g. "Hello", "CB2 8EA".
One of two values, True or False.