Dictionary

Creating a dictionary:

my_dict = {
   "key1":"value1",
   "key2":"value2",
}

In this recipe, both the keys and the values are strings.

Access dictionary

If a dictionary’s keys are chosen wisely, accessing the values in a dictionary is easy and intuitive.

For example, to get the capital for France from europe you can use:

europe['france']