14.7 Changing, Adding and Removing Elements from a Dictionary

Changing elements in a dictionary is very similar to changing the list, except you use the key instead of the index. Consider the car example again:

By accessing the key called "year", we are able to change the value to 1964.5. We can also add to the dictionary in a similar way:

We can also remove key-value pairs by using the del command: