> For the complete documentation index, see [llms.txt](https://kgisl.gitbook.io/lab3003/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://kgisl.gitbook.io/lab3003/docs/linearmap.md).

# LinearMap

A simple implementation of a map using a list of tuples where each tuple is a key-value pair.

## Methods

### **init**

#### Parameters

| name | description | default |
| ---- | ----------- | ------- |
| self |             |         |

### add

Adds a new item that maps from key (k) to value (v). Assumes that they keys are unique.

#### Parameters

| name | description | default |
| ---- | ----------- | ------- |
| self |             |         |
| k    |             |         |
| v    |             |         |

### get

Looks up the key (k) and returns the corresponding value, or raises KeyError if the key is not found.

#### Parameters

| name | description | default |
| ---- | ----------- | ------- |
| self |             |         |
| k    |             |         |
