Skip to content

Latest commit

 

History

History
72 lines (48 loc) · 2.7 KB

File metadata and controls

72 lines (48 loc) · 2.7 KB

Lesson 2.05: Lists Part 2

Learning Objectives

Students will be able to...

  • Define and identify: index, slice, append, pop, remove.
  • Slice a list.
  • Add and remove elements from a list.

Materials/Preparation

Pacing Guide

Duration Description
10 Minutes Do Now
10 Minutes Lesson
30 Minutes Lab
5 Minutes Debrief

Instructor's Notes

1. Do Now

  • Students may need more time than usual to fully go through this lesson's Do Now.

2. Lesson

Instruction

  • Ask students what doing a[0:2] in the Do Now did.
  • Define slicing: a list operation that gives back a list starting from the index to the left of the colon and going up to (but not including) the index to the right of the colon.
  • Ask students what the list would return if you did a[1:2].
  • Explore the differences between remove and pop, asking for student input.
  • Ask students what the plus sign and append do to a list.
  • Ask students to write down or brainstorm how they would represent a Tic-Tac-Toe board using lists.
  • Go over the list in operation. Ask what the return value is (Boolean expression).
  • Have students practice using the in operation in an if statement.

Demonstration

  • Create a Tic-Tac-Toe board with students in class.

3. Lab

  • Students practice slicing, adding, and removing elements from some given lists.
  • Students create a single move Tic-Tac-Toe game.

4. Debrief

  • Check student progress and completion of the lab, wrap up by taking any final questions.

Accommodation/Differentiation

  • If students are moving quickly, start the next topic of using a while loop as a game loop. Explore the concept of keeping score for the game.
  • If students are moving slowly then spend an extra day reviewing lists and completing lab activities.

Quiz Option

There is also an opportunity for a quiz after the game loop lesson and before the project.