Assignment, Variables, Constants & Sequences
Inputs, Outputs & Type Conversion
Condition controlled Loops
Count Controlled loops
Nested Selection and Iteration
Subroutines 1 - Procedures
Subroutines 2 - Functions
Operators and Operations
Structured Programming
Validation and verification
Data Types
Good notes will help you organise and process data and information
Data can be stored in many different forms and the proper term for these forms is ‘data types’. A computer uses special internal codes to keep track of the different types of data it processes. Most programming languages require the programmer to declare the data type of every data object.
The most common data types you will have used are called primitive data types.
Primitive data types are predefined types of data that are supported by the programming language.
Table of the most common data types
In python when we want to convert a variable (cast) to an integer data type we would do the following:
In python when we want to convert a variable (cast) to a real data type we would do the following:
In python when we want to convert a variable (cast) to a string data type we would do the following:
The Boolean data type represents the values of true / false or yes / no. The primitive data type of a Boolean is logical. Boolean logic is a type of mathematical comparison. It is used to evaluate true or false. This may be new to you but it is not difficult to understand. Think about binary numbers. The lights could be on = 1 or off = 0.
Boolean logic evaluates every expression to either true or false.
Casting a variable to a bool can be problematic so we will not be doing that at GCSE.
We can use the type() function to know what the data type of a variable is.
Lets look at the learning outcomes and decide which one best describes our current level of understanding :
Tick the one you feel is closest to your level
AQA Computer Science Tutor