# dictionary.get( ) vs dictionary\[ ]

`dictionary.get` allows you to provide a default value if the key is missing:

```python
dictionary.get("bogus", default_value)
```

returns`default_value`(whatever you choose it to be), whereas

```python
dictionary["bogus"]
```

would raise a`KeyError`.

If omitted,`default_value`is`None`, such that

```python
dictionary.get("bogus")  # <-- No default specified -- defaults to None
```

returns`None`just like

```python
dictionary.get("bogus", None)
```

would.

Reference: [https://stackoverflow.com/questions/11041405/why-dict-getkey-instead-of-dictkey](https://stackoverflow.com/questions/11041405/why-dict-getkey-instead-of-dictkey)
