GCSE · Computer Science · Eduqas · Spec C500QS
String data type
Quick bet: what is "1" + "2"? If you said 3, the computer is about to surprise you.
Computer Science · Data types
Call the output before the computer does
Same + sign. Same digits. Pick how they are stored, then predict what happens.
Choose how the values are stored, step through the program, and commit your call before each result appears. Then switch to the other set and compare.
first = the first valuesecond = the second valueprint(first + second)phone = a telephone numberprint(phone)
Variables
Step 1. first holds the digit 1 inside quotes. Quotes mean it is stored as a string, so it is text.
Computer Science · Choosing the type
Which data type fits?
Pick the most suitable data type for each piece of data.
Still to sort
String (0)
Text made of any number of characters, including digits and symbols.
Where the line is: Data made of digits that you will never calculate with still goes here.
Char (0)
Exactly one character.
Where the line is: If there can be more than one character, it is a string, not a char.
Number (numeric) (0)
A value you will add up or otherwise calculate with.
Where the line is: Being made of digits is not enough. It must be something you calculate with.
WHAT YOU'VE LEARNED
A quick recap of today's lesson.
Why "1" + "2" gives "12", and how to choose the right type for your data.
What you need to know
- A data type defines the kind of data a computer can store and the actions that can be performed on it.
- String is a common data type, and it holds data as text.
- A string is a sequence of characters: letters, digits, spaces and symbols, like the password p@ssw0rd!.
Have a goJo says "a string is just words, so Room 4B can't be a string." Is Jo right?
No. Room 4B is a string.
A string is a sequence of characters, and letters, digits and spaces are all characters.
- Digits in a string are text characters, not a numeric value, so you cannot calculate with them.
- Adding two strings joins them (concatenation): "1" + "2" gives "12", not 3.
Have a goBoth values are strings: "7" and "5". What does "7" + "5" give?
75
Adding strings joins them, so you get the characters 7 and 5 side by side, not 12.
- Use a string for text of more than one character, such as a name or an address.
- Digits you will not calculate with, like a telephone number, go in a string, which also keeps a leading zero.
Have a goA shop stores each item's price (to be totalled) and a customer's mobile number. Which one is the string?
The mobile number.
You never calculate with a mobile number, while the prices need a numeric type to be added up.
- A char holds exactly one character, like a; a string can hold any number of characters.
- The data type decides how data is stored and processed, so the wrong type can lead to errors.
The big picture
A data type defines the kind of data a computer can store and what can be done with it. A string holds data as text, so quoted digits are joined, not added, and a telephone number is safest as a string.
Key points
Worked example
Problem
A school locker has the code 0417. Which data type should a program use to store it, and why?
⚠ Watch out
Thinking anything made of digits is a number. A telephone number is all digits, but you never calculate with it, so it belongs in a string, which also keeps the leading zero.
Memory hook
Will I calculate with it? If not, keep it as text. Quotes mean text, so "1" + "2" is "12".
Check yourself
Without looking back: what is the difference between a char and a string? Give one example of each.
Flashcards
(10)What is a data type?
What does the string data type hold?
Which characters can a string hold?
What is a char?
How does a string differ from a char?
What does "1" + "2" give when both are strings?
Can you do calculations with strings?
Why is a telephone number stored as a string?
Which data type suits a name or an address?
Why does choosing the correct data type matter?
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.