Variables, Constants and Data Types
Aligned to the AQA 8525 specification
- Topic
- Programming
- Level
- Intermediate
- Reading time
- 9 min
- Published
- 8 June 2026
- Updated
- 1 July 2026
On this page
Key takeaways
- AQA requires five data types: integer (whole numbers), real (numbers with a decimal point), Boolean (true or false), character (a single symbol), and string (a sequence of characters).
- A variable is a named memory location whose value can change during execution, while a constant is a named location whose value is fixed at the start and never changed.
- DIV gives integer division (the quotient only, so 7 DIV 2 = 3) and MOD gives the remainder only (so 7 MOD 2 = 1); n MOD 2 = 0 tests whether n is even.
- In Python, input() always returns a string, so values must be converted with int() or float() before arithmetic, otherwise you get a TypeError or silent concatenation.
- In AQA pseudocode the assignment operator is the left arrow and the comparison operator is =; SUBSTRING's third argument is a length, not an end index, and string indices start at 0.
Worth saving these ideas?
Turn what you've read into instant revision cards. Free to get started.
Key terms
- Data type
- A classification that tells the computer how to interpret the bits stored in a value, such as integer or string.
- Integer
- A data type for whole numbers, positive or negative.
- Real
- A data type for numbers with a decimal point, called float in Python.
- Boolean
- A data type holding only the logical values true or false.
- Character
- A data type for a single symbol, such as 'A' or '!'.
- String
- A data type holding a sequence of zero or more characters.
- Variable
- A named location in memory storing a value that can change during execution.
- Constant
- A named location whose value is fixed at the start and never changed.
- DIV
- Integer division, giving the quotient only with no remainder.
- MOD
- The modulo operator, giving the remainder only with no quotient.
- Relational operator
- An operator that compares two values and always produces a Boolean result, such as = or <.
- Concatenation
- Joining two strings together, written with & in AQA pseudocode and + in Python.
Frequently asked questions
DIV is integer division, giving the quotient only with no remainder, so 7 DIV 2 = 3. MOD gives the remainder only, so 7 MOD 2 = 1. A useful pattern is n MOD 2 = 0 to test if n is even, and n DIV 10 to remove the rightmost digit.
Because input() in Python always returns a string, even when the user types a number. Doing arithmetic on an unconverted string causes a TypeError, or silently concatenates instead of adding, so '3' + '5' gives '35' not 8. Convert with int() or float() first.
A variable is a named location in memory that stores a value which can change during the program's execution. A constant is a named location whose value is fixed at the start and never changed, which means a value used in many places can be updated with a single edit.
Generate revision on any topic you study
Type any topic you're studying and Aicademy generates a complete lesson, quiz, and flashcard set, personalised to your level.
Lessons on anything
Structured, level-matched lessons on any topic you study
Practice quizzes
Find out what you actually know before the exam does
Flashcard sets
Lock in key concepts with instant revision cards
Ask Aica
Stuck on something? Get a clear explanation, any time
Merge Sort
Selection and Iteration
Related lessons
7 min
8 min
9 min