Year 9 (ages 13–14, Grade 8 in the US) · Computing · Python: lists and functions · Lesson 3
Functions that process lists
Using built-in list functions, writing functions that total, count and average lists, and validating input with while loops.
Exam boards: this lesson matches the AQA and Pearson Edexcel GCSE computing courses. Check which course your school follows.

15-minute video lesson
Teaching, worked examples and 20 practice questions solved step by step.
Watch free for a monthWhat your child will learn
- Use built-in list functions
- Write functions that process lists
- Count and total with loops
- Validate input
The method
- Can a built-in do it? sum, max, min, len.
- If not, loop through the list.
- Keep a running total or count.
- Validate input with a while loop.
Key words: sum, max, min, average, validation, function.
Worked examples
Worked examples from the lesson, with every step.
Question 1
What does this code print? (The code is shown below.)
- Step 1: Read the code
Answer: 10
Question 2
What does this code print? (The code is shown below.)
- Step 1: Read the code
Answer: 15
Question 3
What does this code print? (The code is shown below.)
- Step 1: Read the code
Answer: [1, 3, 5]