- [Instructor] Before we get into the syntax
of building dictionaries in Python,
let's talk a little bit about
the contents of a dictionary.
Again, a dictionary maps keys to values.
The keys have a couple of requirements.
They must be unique,
and the value that is used as the key
must be of an immutable data type.
As you can see in the table
that we're showing you here,
we have some key types that are strings and integers.
The value types can be whatever you want.
They can be mutable or immutable.
These are just some examples
of potential key value pairs.
We could map, for example, a country's name
over to its Internet country code,
or we could take a decimal integer value
and map it over to its Roman numeral representation.
Or for a state in the United States,
we might have a list
of corresponding agricultural products.
You can see a number of other ones here
in this table as well.
Again, a couple of key things.
The keys must be unique.
The keys must be immutable
so that we can be guaranteed
to find the corresponding value again in the future.
The values are not required to be unique
in this right-hand column here.
You can have whatever values you want
for each individual key.
The value types can be of either mutable
or immutable types in Python.