Instruction
Before we start discussing the use of dictionaries, let's do a quick review of their basics.

In Python, dictionaries are data structures that map keys to values. Dictionaries can contain values of any type, but the keys must be immutable – strings, integers, or even tuples are allowed, but lists aren't. The elements in dictionaries are unordered – there is no "first" or "last" element.
Here are the basic dictionary operations:
- Define a dictionary:
- Access an element with the
'Kate'key: - Update a value:
- Add a new element with the
'Alfred'key: - Delete an element:
scores = {'John': 234, 'Mary': 984, 'Kate': 453}
scores['Kate']
scores['John'] = 237
scores['Alfred'] = 354
del scores['John']
Exercise
We've created a dictionary named movies that stores the number of movies John saw last year. As you see, John saw no biography movies, so we don't need this kind of movie in our dictionary.
Remove the 'biography' record from the movies dictionary.
We also noticed that we don't have 'western' movies in the dictionary. John saw 3 Westerns last year.
Add this record to the dictionary.



