Skip to content
Computer Science · Grade 9

Active learning ideas

Introduction to Lists and Arrays

Active learning works for lists and arrays because students need to see the immediate impact of indexing and iteration on real collections. When students manipulate names, scores, or sorted items themselves, they connect abstract index rules to tangible outcomes. This hands-on practice reduces confusion between conceptual lists and everyday numbered lists by making abstract ideas concrete and testable right away.

Ontario Curriculum ExpectationsCS.HS.AP.9CS.HS.CT.10
25–45 minPairs → Whole Class4 activities

Activity 01

Stations Rotation30 min · Pairs

Pair Programming: Student Roster Manager

Pairs create a list to store class names, then add functions to append new students, access by index, and print the full list via a for loop. They test by simulating class changes and swap roles midway. End with sharing one efficient feature they added.

Analyze scenarios where using a list is more efficient than individual variables.

Facilitation TipDuring Pair Programming: Student Roster Manager, ask pairs to alternate roles every five minutes to keep both students engaged in debugging and writing.

What to look forPresent students with a short code snippet that declares a list and attempts to access an element. Ask: 'What will be printed if the code tries to access the element at index 5 in a list with only 3 items? Explain why.'

RememberUnderstandApplyAnalyzeSelf-ManagementRelationship Skills
Generate Complete Lesson

Activity 02

Stations Rotation45 min · Small Groups

Small Groups: Score Tracker Challenge

Groups build a program using lists for multiple quiz scores, calculate averages with iteration, and compare it to a version with individual variables. Discuss efficiency in scenarios with 5, 10, or 20 scores. Groups demo their code to the class.

Construct a program that manipulates elements within a list.

Facilitation TipFor the Score Tracker Challenge, provide colored sticky notes so groups can visually map list operations on a shared whiteboard before coding.

What to look forProvide students with a scenario: 'A teacher wants to store the scores of 30 students on a test.' Ask them to write two sentences: first, explaining why a list is a better choice than 30 separate variables, and second, writing the first line of code to create an empty list for these scores.

RememberUnderstandApplyAnalyzeSelf-ManagementRelationship Skills
Generate Complete Lesson

Activity 03

Stations Rotation35 min · Whole Class

Whole Class: Unplugged List Sort

Distribute index cards with numbers or words as a physical list. Class practices accessing by position, then sorts collaboratively before coding the same in arrays. Transition to computers for verification and extensions like reversing the list.

Differentiate between accessing elements by index and iterating through a list.

Facilitation TipIn Unplugged List Sort, give each group a shuffled deck of index cards labeled with names to physically move, reinforcing that index 0 is always the first element.

What to look forPose the question: 'Imagine you are building a program to manage a library's book collection. Describe two different ways you might use a list: one where you access elements by index, and another where you iterate through the list. What kind of information would you store in each case?'

RememberUnderstandApplyAnalyzeSelf-ManagementRelationship Skills
Generate Complete Lesson

Activity 04

Stations Rotation25 min · Individual

Individual: Debug List Puzzles

Provide 4-5 buggy code snippets with common list errors like off-by-one indexing. Students fix them one at a time, run tests, and note patterns in a journal. Share fixes in a quick gallery walk.

Analyze scenarios where using a list is more efficient than individual variables.

Facilitation TipFor Debug List Puzzles, print the code snippets on half sheets and have students annotate with arrows and notes to trace index errors visually.

What to look forPresent students with a short code snippet that declares a list and attempts to access an element. Ask: 'What will be printed if the code tries to access the element at index 5 in a list with only 3 items? Explain why.'

RememberUnderstandApplyAnalyzeSelf-ManagementRelationship Skills
Generate Complete Lesson

A few notes on teaching this unit

Start with unplugged sorting to build spatial understanding of indices before writing code. Avoid teaching loops before direct access, as students often conflate the two. Research shows that physical manipulation of items (like cards) followed by immediate pairing with code builds stronger mental models than abstract explanations alone. Emphasize that lists are dynamic: items can be added or removed, so students should test edge cases like empty lists or full lists early.

By the end of this hub, students confidently declare, access, and modify lists without mixing up zero-based indexing or loop logic. You will observe them choosing the right tool—direct access or iteration—for the task and explaining why. Their code should run without off-by-one errors, and they should be able to debug peers’ shared snippets by pointing to the exact index issue.


Watch Out for These Misconceptions

  • During Pair Programming: Student Roster Manager, watch for students treating the first element as index 1 when adding new students to the list.

    Before coding begins, ask each pair to draw a simple list diagram on the whiteboard with indices labeled 0, 1, 2, and have them point to where the next student will be added. Require them to write the correct append statement and explain why index 0 is first.

  • During Score Tracker Challenge, watch for students writing loops to access a single element instead of using direct indexing.

    As groups work, circulate and ask them to time how long it takes to access the score at index 3 using both a loop and direct access. Have them present their findings to the class to highlight the speed difference and reinforce when to use each method.

  • During Unplugged List Sort, watch for students assuming lists and arrays are fundamentally different due to separate vocabulary in the activity.

    After the activity, bring groups together and swap their index cards between list and array representations. Ask them to write the same operations in code for both, then discuss how the operations differ or stay the same, clarifying overlaps through direct comparison.


Methods used in this brief