← VCE Data Analysis

Text data: character and string

Text made of a sequence of characters (single letters, digits or symbols), written in quotes, like 'Sam' or '0412345678'. Phone numbers are strings.

Understanding Text data: character and string in VCE Data Analysis

What it does: Phone numbers are identifiers, not values you do sums with. Storing them as text in quotes keeps the leading 0. A character can be a letter, a digit or a symbol. The # is one symbol, so it is a single character. A string is a sequence of characters stored as text. 'Sam' has three characters, so it is a string. A lone S is just one character. Quotes show that the digits are stored as text. Without quotes, 2025 is a number. An integer would remove the leading 0 and give 800. A string keeps all four characters exactly as written.

Common mistakes: A phone number is a string, so it must be in quotes: phone = "0412345678". Without quotes it is treated as a number and the leading 0 is lost. The string is missing its closing quote. It should be mobile = "0412 345 678".

Class: _____________________  ·  Name: _____________________  ·  Date: _________

Free printable worksheet with full answer key — or add this module to a class and your students practise it interactively.

This module's key terms are also in a printable crossword (Modules 15–24) and word search (Modules 3–24).

Take this worksheet further — free with Cloodit

Each concept is reinforced from every angle — learned, then applied, then tested.

Learning
Duo
Which one is a single character?
'Ace''A'
Matches
phone = 0412345678
↓
The phone number has no quotes, so it is treated as a number and the leading zero is lost. It should be '0412345678'.
Applying
Meanings
Term
string
Meaning
Text made of a sequence of characters (single letters, digits or symbols), written in quotes, like 'Sam' or '0412345678'. Phone numbers are strings.
Practice
initial = 'S'
Testing
Gaps
Data type:
Check Answer
Spots
2initial = "S"
3phone = 0412345678

Cloodit turns curriculum-aligned coding content into journeys students work through one biome at a time.

The 'Pufferfish' badge — Error Handler, one of Cloodit's 106 collectible badges
Students earn collectable badges

Over 100 of them, across seven natural biomes.

Study Buddy
Students build a real study resource

Turns their work into revision material ready for Flash Cards and Exam study.

Diamond Dash — one of Cloodit's live, competitive Sprint games
Students lock in with Sprints

Live, competitive practice for the start of the lesson or a teacher-led lesson finisher.

A Cloodit certificate of achievement, ready to personalise and print
Custom printable certificates

Honour your top performers, or encourage a student who's trying hard — ready to print in seconds.

Quick Questions

1. Which one is a single character?
A. 'Ace'
B. 'A' ✓
A character is one letter, digit or symbol. 'A' is one character, while 'Ace' is a string made of three characters.
2. Which one is a string?
A. S
B. 'Sam' ✓
A string is a sequence of characters stored as text. 'Sam' has three characters, so it is a string. A lone S is just one character.
3. How should a phone number such as 0412 345 678 be stored?
A. As a string, '0412345678' ✓
B. As a number, 412345678
Phone numbers are identifiers, not values we do maths on. Storing them as numbers drops the leading 0, so we store them as strings.
4. Which value is text data (a string)?
A. '2025' ✓
B. 2025
Quotes show that the digits are stored as text. Without quotes, 2025 is a number.
5. True or false: the digit '7' in quotes is a character, not a number.
A. True ✓
B. False
In quotes, '7' is the character for the digit 7, stored as text. You cannot reliably do maths with it until it is converted to a number.

Match the Pairs

'A' → A single character (one letter) written in quotes
'Sam Lee' → A string: a sequence of characters, including a space, stored as text
A phone number is stored as a string so the leading zero is kept → '0412345678'
A single symbol is a character, even though it is not a letter → '#'
phone = 0412345678 → The phone number has no quotes, so it is treated as a number and the leading zero is lost. It should be '0412345678'.
name = Sam → The text has no quotes, so it is not recognised as a string. It should be 'Sam'.

Key Term

string
Text made of a sequence of characters (single letters, digits or symbols), written in quotes, like 'Sam' or '0412345678'. Phone numbers are strings.

Fill in the Blanks

1. Field: Phone Data type: Text
Hint: Type the data type used to store a phone number, which is not used for calculations.
2. phone = "0412345678" print(phone)
Hint: Type the variable name that holds the phone number text, matching the name printed on the next line.
3. print(len("0412345678"))
Hint: Type the function name that counts how many characters are in a string.
4. Initial: Character Name: String
Hint: Type the data type for a sequence of characters, like a whole name.
5. print("04" + "12")
Hint: Type the operator that joins two pieces of text together instead of adding numbers.

Spot the Error

Question 1
A name = "Sam"
B initial = "S"
C phone = 0412345678
D print(phone)
Line C — A phone number is a string, so it must be in quotes: phone = "0412345678". Without quotes it is treated as a number and the leading 0 is lost.
Question 2
A mobile = "0412 345 678
B print(mobile)
C print(len(mobile))
Line A — The string is missing its closing quote. It should be mobile = "0412 345 678".
Question 3
A letter = "B"
B word = Bandicoot
C print(letter)
D print(word)
Line B — Text must be written inside quotes. Without them Bandicoot is read as a variable name. It should be word = "Bandicoot".
Question 4
A first = "Alex"
B last = "Nguyen"
C space = " "
D full = first - space - last
E print(full)
Line D — Strings are joined (concatenated) with +, not -. It should be full = first + space + last.
Question 5
A a = "7"
B b = "5"
C c = a + b
D print("c")
Line D — Quotes make "c" a string, so the letter c would be printed. To show the joined text "75" stored in the variable, use print(c).

Student with a class code? Join your class →