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

  • Do Now
  • Lab - Dictionaries Storing Lists
  • Associated Reading - section 5.3 of Book
  • Read through the do now, lesson, and lab so that you are familiar with the requirements and can assist students

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 list_dictionaries.
        • It is still a dictionary type which 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 list_dictionaries.
  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.