Lists – Methods (append, remove, pop, insert), online

Six activities your students do on their own devices. See who's finished, and their scores.

Lists – Methods (append, remove, pop, insert) in one minute

What students need to know

.append() adds one item to the end of the list. .insert(index, value) adds value at the specified index position.

pop() removes the item AND returns it so you can use it. remove() removes only the first matching item — not all of them.

Mistakes students make

  • append() returns None: don't assign it back. It modifies the list in-place.
  • append() takes exactly one argument: add items one at a time.
  • 5 is not in the list: remove() raises ValueError.
  • Use parentheses () to call methods, not square brackets [].
PREVIOUS · MODULE 35Lists – Slicing
YOU ARE HERE · MODULE 36Lists – Methods (append, remove, pop, insert)
NEXT · MODULE 37Dictionaries – Basics (creation, accessing)

Discover other journeys with this module

What students will learn in this module

Every question in Module 36

Quick questions

  1. What does append() do?AAdds an item to the endBAdds to the start
  2. What does pop() do?ARemoves and returns the last itemBAdds an item
  3. What does remove('cat') do?ARemoves the first 'cat'BRemoves all 'cat'
  4. nums = [1,2,3]\nnums.insert(1, 99)\nWhat is nums?A[99, 1, 2, 3]B[1, 99, 2, 3]
  5. nums = [3,1,2]\nnums.sort()\nWhat is nums?A[3, 2, 1]B[1, 2, 3]

Key terms

Students type the meaning of:

  • .append(item)
  • .insert(index, item)
  • .remove(value)
  • .pop()

Match the pairs

nums = [1,2,3]
nums.remove(99)
Match it to what it does
nums = []
nums.pop()
Match it to what it does
nums.append(4)Match it to what it does
nums.insert(0, 'new')Match it to what it does
n = [1,2,3]
n.append(4)
print(n)
Match it to what it does
n = [1,2,3]
print(n.pop())
Match it to what it does

Fill in the blanks

  1. nums = [1, 2, 3]
    nums.______(4)
    print(nums)
  2. nums = [1, 2, 3]
    nums.______(0, 99)
    print(nums)
  3. pets = ['cat', 'dog']
    pets.______('cat')
    print(pets)
  4. nums = [10, 20, 30]
    last = nums.___()
    print(last)
  5. nums = [3, 1, 2]
    nums.____()
    print(nums)

Spot the error

Question 1

Anums = [1, 2, 3]Bnums = nums.append(4)Cprint('List:', nums)Dprint('Done')

Question 2

Anums = [1, 2, 3]Bnums.append(4, 5)Cprint('List:', nums)Dprint('Done')

Question 3

Anums = [1, 2, 3]Bnums.remove(5)Cprint('List:', nums)Dprint('Done')

Question 4

Anums = [1, 2, 3]Bnums.append[4]Cprint('List:', nums)Dprint('Done')

Question 5

Asorted_nums = [3, 1, 2].sort()Bnums = [3, 1, 2]Cprint('Sorted:', sorted_nums)Dprint('Done')