← Years 7–8 Creating Digital Solutions

Adding to a list with append()

Adds a value to the end of a list, making it one item longer. Start with an empty list like scores = [] and use append() in a loop to build it up.

Understanding Adding to a list with append() in Years 7–8 Creating Digital Solutions

What it does: The loop runs 5 times and each time append() adds the current value of i to the end of the nums list. The text typed by the user is given to append(), so it is added to the end of the names list. Python lists use the append() method to add an item to the end. There is no add() method for lists. append() puts 'cat' into the empty list, so the list now has one item. Square brackets [] make a list. Round brackets () make something different, and it has no append(). The new value 3 goes on the end, after the items that were already there.

Common mistakes: Lists do not have an add() method. To put a value on the end of a list you use append(), so the line should be scores.append(s). append is a method, so the value goes inside round brackets, not square brackets. It should be names.append("Sam").

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 50–125) and word search (Modules 3–125).

Take this worksheet further — free with Cloodit

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

Learning
Duo
Which line adds the number 5 to the end of the list scores?
scores.append(5)scores.add(5)
Matches
fruit = [] fruit.append["apple"]
↓
append is a method so it needs round brackets (), not square brackets []. It should be fruit.append("apple").
Applying
Meanings
Term
list.append(value)
Meaning
Adds a value to the end of a list, making it one item longer. Start with an empty list like scores = [] and use append() in a loop to build it up.
Practice
scores = []
Testing
Gaps
= []
Check Answer
Spots
3 s = int(input("Score: "))
4 scores.add(s)

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

The 'Peregrine Falcon' badge — Operator Ace, 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 line adds the number 5 to the end of the list scores?
A. scores.append(5) ✓
B. scores.add(5)
Python lists use the append() method to add an item to the end. There is no add() method for lists.
2. What does pets look like after this code runs? pets = [] pets.append('cat')
A. ['cat'] ✓
B. []
append() puts 'cat' into the empty list, so the list now has one item.
3. Where does append() put the new value?
A. At the start of the list
B. At the end of the list ✓
append() always adds to the end, so the new item becomes the last one in the list.
4. Which line creates an empty list ready for append()?
A. names = ()
B. names = [] ✓
Square brackets [] make a list. Round brackets () make something different, and it has no append().
5. What is the list after this code runs? nums = [1, 2] nums.append(3)
A. [1, 2, 3] ✓
B. [3, 1, 2]
The new value 3 goes on the end, after the items that were already there.

Match the Pairs

scores = [] → Starts with an empty list that has no items yet, ready to be filled with append()
pets.append("cat") → Adds the value "cat" to the end of the pets list, making it one item longer
Use append() inside a loop to build a list of the numbers 0 to 4 → for i in range(5): nums.append(i)
Ask the user for a name and add it to the end of the names list → names.append(input("Name: "))
fruit = [] fruit.append["apple"] → append is a method so it needs round brackets (), not square brackets []. It should be fruit.append("apple").
scores = [] scores = scores.append(10) → append() changes the list itself and gives back None, so assigning the result wipes out the list. It should be just scores.append(10).

Key Term

list.append(value)
Adds a value to the end of a list, making it one item longer. Start with an empty list like scores = [] and use append() in a loop to build it up.

Fill in the Blanks

1. scores = [] scores.append(9)
Hint: Type the variable name that holds the empty list
2. scores = [] scores.append(10)
Hint: Type the method name that adds an item to the end of a list
3. scores = [] for i in range(5): scores.append(i)
Hint: Type the function that makes the loop repeat a set number of times
4. scores = [] for i in range(5): scores.append(i * 2)
Hint: Type the operator that multiplies the two numbers
5. scores = [] score = int(input("Score: ")) scores.append(score)
Hint: Type the variable that holds the value to add to the list

Spot the Error

Question 1
A scores = []
B for i in range(3):
C s = int(input("Score: "))
D scores.add(s)
E print(scores)
Line D — Lists do not have an add() method. To put a value on the end of a list you use append(), so the line should be scores.append(s).
Question 2
A names = []
B names.append["Sam"]
C names.append("Mia")
D print(names)
Line B — append is a method, so the value goes inside round brackets, not square brackets. It should be names.append("Sam").
Question 3
A pets = []
B pets.append("cat"
C pets.append("dog")
D print(len(pets))
Line B — The closing bracket is missing. Every append( needs a matching ). It should be pets.append("cat").
Question 4
A nums = 0
B for i in range(5):
C nums.append(i)
D print(nums)
Line A — nums is set to the number 0, not a list, so nums.append(i) would fail. Start with an empty list: nums = [].
Question 5
A totals == []
B for i in range(4):
C totals.append(i * 2)
D print(totals)
Line A — A double equals sign compares values. It does not create the list. Use a single equals sign to assign: totals = [].

Student with a class code? Join your class →