← VCE Software Development U3O1

One-dimensional arrays

A named, ordered collection of elements of the same data type. Each element is reached by its index, its position number (0-based in Python, often 1-based in pseudocode).

Understanding One-dimensional arrays in VCE Software Development U3O1

What it does: All three elements are strings, so the array holds one consistent data type. append() adds a new element to the end of a Python list, making it grow. A fixed-size array would not allow this. An array stores many elements under one name, in order, and each element is reached by its index. Python uses zero-based indexing, so the first element is at index 0. The index is the position number used to reach an element. The value is the data stored at that position. An array of four elements has indexes 0, 1, 2 and 3. Using scores[4] goes past the end.

Common mistakes: Python arrays (lists) are zero-based, so the first element is at index 0. scores[1] is the second element. It should be first = scores[0]. The list is missing its closing square bracket. It should be names = ["Ava", "Liam", "Mia"].

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 72–96) and word search (Modules 72–113).

Take this worksheet further — free with Cloodit

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

Learning
Duo
Which statement describes a one-dimensional array?
A single variable that holds exactly one valueA named, ordered collection of elements of the same data type
Matches
scores = [72, 85, 90, 64]\nprint(scores[4])
↓
Index 4 is out of range. With zero-based indexing the valid indexes are 0 to 3, so the last element is scores[3].
Applying
Meanings
Term
one-dimensional array
Meaning
A named, ordered collection of elements of the same data type. Each element is reached by its index, its position number (0-based in Python, often 1-based in pseudocode).
Practice
marks = [72, 85, 90, 64]
Testing
Gaps
print(scores[])
Check Answer
Spots
1scores = [72, 85, 90, 64]
2first = scores[1]

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

The 'Hyena' badge — Savannah Debugger, 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 statement describes a one-dimensional array?
A. A named, ordered collection of elements of the same data type ✓
B. A single variable that holds exactly one value
An array stores many elements under one name, in order, and each element is reached by its index.
2. In Python, scores = [70, 85, 92]. Which expression gives the first element?
A. scores[0] ✓
B. scores[1]
Python uses zero-based indexing, so the first element is at index 0.
3. An array in VCAA-style pseudocode starts at index 1. What is the index of the third element?
A. 2
B. 3 ✓
With one-based indexing, the first element is at 1, so the third element is at index 3. In Python (zero-based) it would be 2.
4. Which array follows the rule that every element has the same data type?
A. [12, 7, 19, 4] ✓
B. [12, "seven", 19.5, True]
A true array holds elements of one data type, such as all integers. The second example mixes integer, string, float and Boolean.
5. names = ["Ava", "Liam", "Mia"] has 3 elements. Which index causes an index out of range error?
A. names[2]
B. names[3] ✓
Valid Python indexes are 0, 1 and 2. Index 3 is past the last element, so it causes an IndexError.

Match the Pairs

scores = [72, 85, 90, 64] → Creates a one-dimensional array (list) of four integers named scores
scores[2] → Reaches the third element of the array, 90, using index 2 (zero-based)
Every element in a one-dimensional array should have the same data type → names = ["Ava", "Liam", "Mia"]
A growing list can add an element, while a fixed-size array keeps the same number of elements → scores.append(78)
scores = [72, 85, 90, 64]\nprint(scores[4]) → Index 4 is out of range. With zero-based indexing the valid indexes are 0 to 3, so the last element is scores[3].
FOR i FROM 0 TO 5 PRINT scores[i] (array has 5 elements, 1-based) → The loop starts at 0 but the array is 1-based. The loop should run from 1 to 5 so every element is reached and no invalid index is used.

Key Term

one-dimensional array
A named, ordered collection of elements of the same data type. Each element is reached by its index, its position number (0-based in Python, often 1-based in pseudocode).

Fill in the Blanks

1. scores = [85, 92, 78, 64] print(scores[0])
Hint: Type the index of the first element (Python counts from the start of the array).
2. scores = [85, 92, 78, 64] print(scores[3])
Hint: Type the index of the last element in this four-element array.
3. scores = [85, 92, 78, 64] count = len(scores)
Hint: Type the function that returns how many elements the array holds.
4. scores = [85, 92, 78, 64] scores.append(70)
Hint: Type the list method that adds a new element to the end, making the list grow.
5. scores = [85, 92, 78, 64] scores[2] = 99
Hint: Type the index that replaces the third element, remembering the first index is zero.

Spot the Error

Question 1
A scores = [72, 85, 90, 64]
B first = scores[1]
C last = scores[3]
D print(first, last)
Line B — Python arrays (lists) are zero-based, so the first element is at index 0. scores[1] is the second element. It should be first = scores[0].
Question 2
A names = ["Ava", "Liam", "Mia"
B print(names[0])
C print(len(names))
Line A — The list is missing its closing square bracket. It should be names = ["Ava", "Liam", "Mia"].
Question 3
A marks = [50, 60, 70]
B total = 0
C for m in marks:
D total = total + 1
E print(total)
Line D — This adds 1 each time instead of adding each element's value. It should be total = total + m.
Question 4
A temps ← [18, 21, 19, 25, 23]
B FOR i ← 1 TO 6
C PRINT temps[i]
D END FOR
Line B — The array has 5 elements, indexed 1 to 5 in this 1-based pseudocode. Going to 6 is out of range. It should be FOR i ← 1 TO 5.
Question 5
A items = [4, 8, 15, 16]
B for i in range(len(items)):
C print(items[i + 1])
Line C — items[i + 1] skips the first element and goes out of range on the last loop. It should be print(items[i]).

Student with a class code? Join your class →