Oliver Irwin
16th March 2023
Say you are a teacher and you are grading students
You want to store the grades in a variable, but keep the information relating to the student available
The previous example shows how impractical using lists in this situation is
Python introduces another complex data type to
represent structured data :
dict
In Python, dicts are created like variables
The data has to be enclosed by brackets {
The elements have to be separated by commas ,
The elements are key-value pairs
To access an element in a dict, you use its key
You can add elements by adding a key