More lookup practice

Contents

More lookup practice#

Let’s take a look at some more interesting dictionaries we can create using this.

Integers as Keys#

int_dict = {2:"two", 5:"five", 7:"seven", 9:"nine"}
str_dict = {"three":3, "seven":7, "nine":9}

You may find it helpful to take some little time to practice creating and accessing values from keys in these dictionaries in a workspace. After all, practice makes perfect!

In the questions below, we ask what value is associated with given keys in the corresponding dictionaries.