Students will be able to...
- Create dictionaries with keys and values of different types.
- Update, append, or remove list values in a dictionary.
- 6.03 Slide Deck
- Do Now
- Lab - Dictionaries Storing Lists (docx) (pdf)
- Associated Reading
- Read through the Do Now, lesson, and lab so that you are familiar with the requirements and can assist students.
Duration | Description |
---|---|
5 Minutes | Do Now |
10 Minutes | Lesson |
35 Minutes | Lab |
5 Minutes | Debrief |
- 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.
- 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.
- 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
.
- 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.
- Discuss any confusion or problem areas the students faced.
- Talk about how
in
works for dictionaries, specifically for the bonus.
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.