Unit bundle · Key Stage 3

Python: Lists and Functions – Year 9 Computing lessons

Six Year 9 Python lessons on lists, looping through lists, procedures, functions, parameters and return values.

Also in a bundle Year 9 Computing – a full year of KS3 lessons 36 lessons for £89 · save 38% on buying separately

Pupils finish Year 8 able to write programs with variables, selection and loops, but every value still needs its own variable and every program is one long block. This unit gives them the two tools real apps are built from: lists, which store many values under one name, and subprograms – procedures and functions – which split a program into named, reusable parts that pass data with parameters and return values. Pupils build a leaderboard manager for the school's lunchtime games club one feature at a time, then make it modular, so they can explain how lists and functions let programmers build bigger programs without losing control of them.

Unit 9.1 is taught in Year 9, Autumn 1, and answers one big question: How do lists and functions help us build bigger programs? Every lesson uses the same real-world context (apps that manage lists: playlists, leaderboards, shopping lists), and pupils make a leaderboard or playlist manager. The careers link is an app developer: an app developer stores data such as playlists, scores and shopping lists in lists, and splits the app into small functions that can each be tested and reused – exactly how pupils build their leaderboard.

What happens in each lesson:

Lesson 1, Recap: loops and selection: How can we predict what a program does before running it? Main task: complete a trace table for the games-club scoring program, then predict its output and run the program to check.

Lesson 2, Lists: storing many values: How can one variable store a whole list of values? Main task: write a program that stores the games club's top five scores in a list, prints the top score and the fifth score using their indexes, then replaces one score and prints the new list.

Lesson 3, Looping through lists: How can a program visit every item in a list? Main task: write a program that asks for four new game scores, appends each one to a list, then traverses the list to print every score and the total.

Lesson 4, Procedures and functions: Why do programmers split programs into named subprograms? Main task: write a procedure show_menu() that prints the leaderboard's menu and a function get_score() that asks for a score and returns it as an integer, then call each one from the main program.

Lesson 5, Parameters, return values and a modular program: How do functions pass data around a modular program? Main task: write a function highest(scores) that takes a list of scores as a parameter and returns the highest score, then call it from the main program and print the result.

Lesson 6, Progress Check: 16-question check: 15 multiple-choice questions + one applied question.

Misconceptions it tackles include
“The inner IF of nested selection is still checked when the outer IF is False”; “The first item in a list is at index 1”; “In for score in scores:, score is the position number of each item”. Each is planned into a hinge question before the main task or an exit question, so you find out who still holds it.

National Curriculum coverage (KS3 computing programme of study): NC3, two or more languages, at least one textual; data structures; modular programs with procedures or functions.

It builds on 8.1 Python: Iteration and Boolean Operators (for and while loops, elif, AND, OR and NOT, test plans); 7.6 Introduction to Python (variables, input, casting and if/else); 8.6 Physical Computing (Python on a micro:bit). It leads on to 9.2 Searching and Sorting (searching and sorting lists, coded as functions), 9.3 Cyber Security (a Caesar cipher function), 9.5 Modelling the Real World (coding a model with functions) and 9.6 Digital Project for a Real User; at GCSE, arrays and subprograms (OCR J277 2.2).

Adapting it for your school
Works in any Python 3 editor: IDLE, Thonny, or a free online editor that runs input(). Lesson 1 is a flex lesson: if 8.1 was taught recently, fold its nested-selection trace into the Bell Task of lesson 2. If the computers are not available, use the unplugged slides and printed trace tables: the learning is the same. Swap the games-club leaderboard for another list your pupils care about, such as a playlist or a sports-day results table; the code patterns stay the same.

Two versions in one download. The "With quiz" folder is for schools with a Code & Commerce Quizzes subscription: wherever the lessons use a Progress Check, its multiple-choice questions are ready-made on the quiz site for you to set, with a printed version as the backup. The "Without quiz" folder is the same teaching for standalone use, with no mention of the quiz site and every check on paper. You don't need a quiz subscription to use it.

What's included

  • 6 lesson slide decks (PowerPoint)
  • 6 lesson plans (Word)
  • 6 worksheets, plus 5 support versions with scaffolds (Word)
  • Medium term plan with intent, key words, misconceptions and adaptive teaching notes (Word)
  • Progress Check lesson to assess the unit, with an applied question
  • Parameters return values and a modular program - Quiz Quiz Trade Cards
  • Department licence: every teacher in your department can use and adapt it
  • Two versions of the files: one for Code & Commerce Quizzes subscribers and one for standalone teaching, no quiz site needed

In this bundle

Worth £24 bought separately at £4 a lesson. The bundle saves you 16%.

More for KS3 Computing

See all

Written for the specifications named. Not endorsed by or affiliated with any exam board.