Skip to content
Computer Science · Grade 10

Active learning ideas

Complex Data Structures: Lists and Arrays

Active learning works for lists and arrays because students often confuse abstract references with concrete values. When they build real projects like shopping lists or class rosters, the gaps in their understanding become visible and fixable immediately, rather than waiting for a test.

Ontario Curriculum ExpectationsCS.HS.P.2CS.HS.A.4
25–45 minPairs → Whole Class4 activities

Activity 01

Problem-Based Learning35 min · Pairs

Pair Programming: Shopping List Builder

Partners start with an empty list and use input() to add grocery items via append(). They access items by index to display prices, remove out-of-stock items with pop(), and slice for categories. Pairs test and swap code for feedback.

Differentiate between a single variable and a list/array for storing multiple values.

Facilitation TipBefore starting Pair Programming: Shopping List Builder, model reading a list index aloud to reinforce zero-based counting.

What to look forPresent students with a short Python code snippet that attempts to add an element to a list. Ask them to predict the output and explain why the code works or fails, focusing on list mutability and append operations.

AnalyzeEvaluateCreateDecision-MakingSelf-ManagementRelationship Skills
Generate Complete Lesson

Activity 02

Problem-Based Learning45 min · Small Groups

Small Groups: Search Race Simulation

Groups receive printed lists of 10, 50, and 100 numbers. They time manual linear searches for targets, then code the same in Python and compare runtimes. Discuss why larger lists slow searches and brainstorm improvements.

Construct code to add, remove, and access elements within a list.

Facilitation TipDuring Search Race Simulation, circulate with a timer to make the race feel urgent and real, prompting students to think about search efficiency.

What to look forProvide students with a scenario: 'You need to store the names of all students attending a school club meeting.' Ask them to write down: 1. Which data structure (list or array) is more appropriate and why. 2. One line of Python code to add a new student's name to their chosen structure.

AnalyzeEvaluateCreateDecision-MakingSelf-ManagementRelationship Skills
Generate Complete Lesson

Activity 03

Problem-Based Learning30 min · Whole Class

Whole Class: Class Roster Manager

Follow teacher-led code to build an array of student names. Add late arrivals with insert(), remove graduates with del, and loop to print attendance. Class votes on extensions like sorting.

Analyze the efficiency of different methods for searching within a list.

Facilitation TipBefore the Class Roster Manager begins, demonstrate sorting a small list so students see how order affects search speed.

What to look forPose the question: 'Imagine you have a list of 1000 numbers and need to find a specific number. Would it be faster to search from the beginning every time, or to sort the list first and then search? Explain your reasoning, considering the efficiency of different search methods.'

AnalyzeEvaluateCreateDecision-MakingSelf-ManagementRelationship Skills
Generate Complete Lesson

Activity 04

Problem-Based Learning25 min · Individual

Individual: Debug List Challenges

Provide 5 code snippets with errors like off-by-one indexing or mutable aliasing. Students fix, run, and explain changes in comments. Share one fix with the class.

Differentiate between a single variable and a list/array for storing multiple values.

Facilitation TipFor Debug List Challenges, provide printed code with syntax errors first, so students practice fixing before writing their own.

What to look forPresent students with a short Python code snippet that attempts to add an element to a list. Ask them to predict the output and explain why the code works or fails, focusing on list mutability and append operations.

AnalyzeEvaluateCreateDecision-MakingSelf-ManagementRelationship Skills
Generate Complete Lesson

A few notes on teaching this unit

Start with concrete analogies like a bookshelf for lists and an egg carton for fixed-size arrays. Have students map physical objects to code to reduce abstraction overload. Avoid rushing to abstract examples; let students struggle with real lists first. Research shows that early exposure to mutability bugs helps students debug later, so embrace the mess of unexpected changes.

Students should confidently declare, modify, and traverse lists and arrays without mixing up indices or mutability rules. They will explain why zero-based indexing matters and choose the right method to add or remove items. Their code will run without IndexError exceptions and produce correct outputs during peer review.


Watch Out for These Misconceptions

  • During Pair Programming: Shopping List Builder, watch for students counting items starting at 1 instead of 0 when inserting new elements.

    Pause the pair work and ask them to label each item position on a printed list from 0 to n-1, then trace the code step-by-step while pointing to the labels to correct the offset.

  • During Search Race Simulation, watch for students assuming all list items must be numbers or all strings.

    Have them add mixed entries like 'apple', 3.14, 'banana' to their lists and explain how Python handles different types in the same collection.

  • During Debug List Challenges, watch for students believing that list1 = list2 creates a new independent copy.

    Ask partners to run a quick test by modifying list2 and observing list1 changes, then prompt them to research the .copy() method to fix the issue.


Methods used in this brief