Skip to content

Latest commit

 

History

History
64 lines (42 loc) · 2.55 KB

File metadata and controls

64 lines (42 loc) · 2.55 KB

Lesson 6.03: Dictionaries of Lists

Learning Objectives

Students will be able to...

  • Create dictionaries with keys and values of different types.
  • Update, append, or remove list values in a dictionary.

Materials/Preparation

Pacing Guide

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

Instructor's Notes

1. Do Now

  • Display the Do Now on the board.
  • Students will explore how to use dictionaries containing lists, as well as how to add values to those lists.

2. Lesson

Discuss Part 1 of the Do Now

  • Go over the type of weekend_dates.
  • It is still a dictionary type. In this case the dictionary goes from string (key) to list (value).
  • Dictionaries can also go from numbers to lists, or numbers to strings, or any other combination.

Discuss Part 2 of the Do Now

  • Review how you update a value within a dictionary, as well as how to append and remove items from lists.
  • Have students continue practicing adding and removing values from weekend_dates.

3. Lab

  • Students will create a dictionary representing a weekly to-do list.
  • The user can add items to the to-do list or have the program print what items must be done on a certain day.

4. Debrief

  • Discuss any confusion or problem areas the students faced.
  • Talk about how in works for dictionaries, specifically for the bonus.

Accommodation/Differentiation

Students that are moving quickly should work on the bonus activity in the lab. They can also be paired with students that are struggling (with close monitoring, as needed), as this lab requires pulling together a variety of concepts and skills: looping, conditionals, lists, and dictionaries.