Skip to main content Link Search Menu Expand Document (external link)

Dictionaries

Dictionaries are another data structure in Python. We’ve used variables, which can store one thing, and lists, which can store many of the same thing. Dictionaries are a little like lists, except more structured. Things stored in dictionaries are stored in pairs. These pairs are called “key-value pairs” and work like actual paper dictionaries, which have words with definitions attached to them. The word is the key, and the definition is the value associated with that key.

Readings

Summary

For this week’s summary, think about what you already know about other ways of storing data in Python, like variables and lists. Think about how dictionaries are different from those structures.

Summary prompt: What do you think dictionaries might be useful for in Python?

Question

As per usual, your question can be one of three types:

  • Confusion: what didn’t you understand in the readings?
  • Curiousity: what do you want to know more about?
  • Connection: how does this topic connect to your own experiences?

Submit your summary+question on D2L under Quizzes before class starts on Tuesday.