A simple implementation of a map using a list of tuples where each tuple is a key-value pair.
self
Adds a new item that maps from key (k) to value (v). Assumes that they keys are unique.
k
v
Looks up the key (k) and returns the corresponding value, or raises KeyError if the key is not found.
Last updated 4 years ago