Java has a built-in called
HashMap. It allows you to store and very quickly retrieve key value pairs.
In Python, this is called a
Dictionaries as HashMaps
An example of a dictionary in Python is as follows:
The same can be created using the
A third way to create and populate this:
As per our last creation option, accessing is much the same.
Deleting a value
Deleting a value is as simple as calling the key with the
This will result in the following output: