A dictionary is a data type similar to arrays, but works as a key-value store.
We access it with keys and values instead of indexes.
The values stored in a dictionary can be accessed using a key, which is any type of object (a string, a number,) instead of using its index to address it.
Note: In Java world, this is called a HashMap.
Here are some Python dictionary examples:
Iterating through the dictionary:
Now, to remove an item, we can either use pop or del notation. Note: you will be accessing the dict by the key.
The output only shows Steve, because both the items (Jake and Liz) have been removed.
Dictionaries are simple, but powerful. A lot of problems can be solved using this.