GCSE · Computer Science · Eduqas · Spec C500QS
Integer data type
Store a telephone number as an integer and its first digit quietly vanishes. Let's work out why, and how to choose a data type that doesn't wreck your data.
Sort it
Does it deserve to be an integer?
Ask two questions of each item. Is it always a whole number? And is it a number you work with, or just a label made of digits where a leading zero matters? Tap an item, then choose where it goes.
Still to sort
Integer is suitable (0)
Always whole numbers, and used as numbers.
Where the line is: Whole numbers only. Positive, negative or zero are all fine.
Integer is not suitable (0)
Can have a fractional part, or digits that are only a label.
Where the line is: Either it can have a fractional part, or it is a digit sequence you never calculate with and whose leading zero matters.
Why bother with data types?
Reason it through
Why does choosing the right data type matter?
First link · your turn
What does a data type decide about an item of data?
Run it and see
What does the wrong choice actually do?
This program stores a count of players, a height and a telephone number. Press Run, read what comes back, then choose a fix for the flagged line and run it again. Keep going until the output is right.
You do not need to learn Python syntax here. Read the output and the message, and ask what the data type did.
- players = 4
- arrivals = 3
- print(players + arrivals)
- height = int("1.75")
- print(height)
- phone = int("07700900123")
- print(phone)
Messages and outputs checked by running these exact programs in Python 3.13.
WHAT YOU'VE LEARNED
A quick recap of today's lesson.
Whole numbers, and how to tell when data deserves to be one.
What you need to know
- A data type tells the computer what kind of data it's storing and what can be done with it.
- Integer is one common data type. It stores whole numbers, like 3.
- An integer can be positive, negative or zero, so 42, -7 and 0 are all integers.
- An integer has no fractional part. A value such as 5.3 is not an integer.
Have a goHere are five values: 7, -2, 0, 5.3 and 100. Which one is not an integer?
5.3
It has a fractional part. The others are whole numbers, and negative and zero count.
- Use integer when the values are always whole numbers, like a count of items or a number of people.
- Don't use integer for data that can have a fractional part, like a measurement with a decimal part.
Have a goYour classmate Sam says: 'I'll store my hamster's weight as an integer. It's 34.7 g.' Good plan?
No. 34.7 has a fractional part, so integer isn't suitable.
Integer only suits data whose values are always whole numbers; a measurement with a decimal part isn't.
- Integer values can be used in arithmetic calculations.
- A telephone number isn't suitable for integer: you never calculate with it, and an integer doesn't keep leading zeros.
Have a goWhich one should not be an integer: pupils in a class, a locker code such as 0417, or a goal difference of -2?
The locker code, 0417.
You never calculate with it, and its leading zero matters but an integer would drop it. The other two are whole numbers you can work with.
- Data types exist so data is stored and processed correctly. The wrong type can cause errors.
The big picture
An integer is a whole number: positive, negative or zero, with no fractional part. Use it for data that is always whole, like counts. Don't use it for data with a decimal part, or for digit sequences such as telephone numbers where a leading zero matters.
Key points
Worked example
Problem
A quiz app records two things for each player: how many questions they got right (for example 12) and their average answer time (for example 3.4 seconds). Decide whether each should be an integer, then say what the app can do with the one that should.
⚠ Watch out
Thinking anything made of digits is an integer. A telephone number is all digits, but you never calculate with it and its leading zero matters, so integer is the wrong choice.
Memory hook
Ask two questions: always whole? and do I work with it as a number? Count of people: yes and yes. Telephone number: no, it's just a label made of digits.
Check yourself
Detentions this term (could be 0), mean test score (such as 61.5), locker code (such as 0482). Which one suits integer, and why not the other two?
Flashcards
(11)What is a data type?
What does the integer data type store?
Which of these are integers: 42, 5.3, -7, 0?
Why is 5.3 not an integer?
When is integer a suitable data type?
Why is integer unsuitable for a measurement with a decimal part?
What can you do with integer values?
Why not store a telephone number as an integer?
Two questions to ask before choosing integer?
Why do programs use data types?
What can go wrong if you pick the wrong data type?
Tap any card to flip it, or use Study as deck to go through them one at a time. In the full lesson these run as a spaced-repetition deck — you rate each card Hard, Good or Easy and the tricky ones keep coming back until they stick.
Learning with Lightbulb is opening soon
You can use this lesson now. Join the waitlist and we'll let you know when the full Lightbulb experience is ready.
Keep me postedMore Eduqas GCSE Computer Science topics
How this lesson was checked. This Eduqas GCSE Computer Science (specification C500QS)lesson was published through Lightbulb Learning's human-designed editorial process — the educational standards, accuracy rules and publication checks it must pass were authored and approved by Philip Halpin. It passed subject-specific assessment, automated educational checks and technical publication verification before going live (publication checks completed 16 November 2026). Published pages are monitored, human spot-checking is ongoing across the lesson library, and anything found wrong is corrected or withdrawn. How our lessons are made and checked. Spotted a mistake? Email hello@lightbulblearning.co and we'll review it.