Teach Your Code to Remember Lots of Things!

Learn to store and retrieve labeled data using dictionaries.

So far, you’ve used variables to store single pieces of data and lists to store collections. But what if you want to label your data with keywords? That’s where dictionaries come in—Python’s way of storing key–value pairs!

A dictionary in Python

Think of a dictionary like a real one:

  • We look up a word (the key).

  • We get a definition (the value).

Let’s look at the syntax first:

Get hands-on with 1400+ tech skills courses.