Students will be able to...
- Define and identify: index, slice, append, pop, remove.
- Slice a list.
- Add and remove elements from a list.
- 2.05 Slide Deck
- Do Now
- Lab - Tic-Tac-Toe (docx) (pdf)
- Associated Readings 2.5
- Read through the Do Now, lesson, and lab so that you are familiar with the requirements and can assist students.
Duration | Description |
---|---|
10 Minutes | Do Now |
10 Minutes | Lesson |
30 Minutes | Lab |
5 Minutes | Debrief |
- Students may need more time than usual to fully go through this lesson's Do Now.
- 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
andpop
, 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.
- Create a Tic-Tac-Toe board with students in class.
- Students practice slicing, adding, and removing elements from some given lists.
- Students create a single move Tic-Tac-Toe game.
- Check student progress and completion of the lab, wrap up by taking any final questions.
- 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.
There is also an opportunity for a quiz after the game loop lesson and before the project.