Question: In python3, (specifically 3.6 onwards) the dictionary keeps the ordering, which is great. However, I would like to initialize a dict with a kv pair 'at the end'. For example:

```
>>> data = {
    'Z': []
    # 'from': ['tos'], // adjacency list
}
>>> data['a']='b'
>>> data['b']='c'

>>> data
{'Z': [], 'a': 'b', 'b': 'c'}

```

Is this possible to do? What I want is as follows:

```
>>> data
{'a': 'b', 'b': 'c', 'Z': []} # 'Z' is the last element

```

Answer: 
I am not 100% certain if I understand what you would like to do but is it this: 

```
from collections import OrderedDict
data = OrderedDict({
    'Z': []
})

def add_to_dict(key, value): 
    data[key] = value
    data.move_to_end('Z')

add_to_dict('a', 'b')
print(data).  # OrderedDict([('a', 'b'), ('Z', [])])

```
```
class CustomDict(dict):
    def move_to_end(self, key):
        value = self[key]
        del self[key]
        self[key] = value

d = CustomDict({"z": [], "hey": "world"})
d.move_to_end("z")
print(d)

```

Outputs:

```
{'hey': 'world', 'z': []}

```

You could also create a custom `dict` object to automatically place the key `z` unto the end, but that is a bit more work. Check out this post [here](https://stackoverflow.com/questions/4014621/a-python-class-that-acts-like-dict) for reference.