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 value
second = the second value
print(first + second)
phone = a telephone number
print(phone)

Variables

first="1"

Step 1. first holds the digit 1 inside quotes. Quotes mean it is stored as a string, so it is text.

Step 1 of 5Called right: 0 of 2

Computer Science · What can a string hold?

Words only? Not quite

A programmer wants to store the password p@ssw0rd! in a program.

Which is closest to what you think a string can hold?
How sure are you?

Exam line: A string is a sequence of characters, so it can hold letters, digits, spaces and symbols.

Computer Science · Three types side by side

String, char or number?

For each type, tick every property that is true. Then check the grid.

String
Char
Number (a numeric type)

Exam line: A string is text of any length, a char is exactly one character, and a numeric type is for values you calculate with.

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.

6 of 6 still to sort.

Exam line: Ask two questions: how many characters, and will I calculate with it? Digits you never calculate with belong in a string.

Computer Science · Write it up

Justify the type

A form has a field for a pupil's telephone number, for example 07700 900123. State a suitable data type for this field, justify your choice, and describe what could go wrong if an incorrect data type were used. [3 marks]

0 words · your answer stays on this page and is not sent anywhere.

Exam line: Name the type, give a reason from the data, then say what would go wrong with the wrong type.

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

1Quotes mean text. "1" + "2" joins to "12"; only numbers add to give 3.
2A string is a sequence of characters of any length. A char is exactly one.
3Made of digits is not the same as a number. If you will not calculate with it, use a string.
4A telephone number as a string keeps its leading zero; as a numeric type the zero is dropped.

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?
It defines the kind of data a computer can store and the actions that can be performed on it.
What does the string data type hold?
Data as text: a sequence of characters.
Which characters can a string hold?
Letters, digits, spaces and symbols, for example the password p@ssw0rd!.
What is a char?
A data type that holds a single character, for example the letter a.
How does a string differ from a char?
A string can hold any number of characters (a sequence). A char is exactly one.
What does "1" + "2" give when both are strings?
"12". Adding strings joins them (concatenation); it does not add their values to give 3.
Can you do calculations with strings?
No. Digits stored in a string are treated as text characters, not as a numeric value.
Why is a telephone number stored as a string?
You will not calculate with it, and a string keeps the leading zero that a numeric type would drop.
Which data type suits a name or an address?
String: text made of more than one character.
Why does choosing the correct data type matter?
The type determines how data is stored and processed, and using an incorrect one can lead to errors.

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 posted

More Eduqas GCSE Computer Science topics

See the full Eduqas Computer Science curriculum →

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.