Question: I'd appreciate help for this apparently simple task: write a function that will take a tuple and return a nested dictionary, with each successive value in the tuple being a key in a successively deeper 'layer' of the dictionary.  

The ultimate 'value' at the bottom of the rainbow is specified (say 10, in the following example).

So from the tuple `('cat', 'dog', 'bone')`, I'm aiming to have as an output: 

```
{'cat':{'dog':{'bone':10}}}

```

and to do this for tuples of arbitrary length.

Answer: 
```
t = ('cat','dog','bone')
answer = {}
temp = answer
for key in t[:-1]:
    if key not in temp:
        temp[key] = {}
    temp = temp[key]
temp[t[-1]] = 10

```

Output:

```
In [21]: answer
Out[21]: {'cat': {'dog': {'bone': 10}}}

```
My attempt as well:

```
>>> t = ('cat', 'dog', 'bone')
>>> last = {t[-1]: 10}
>>> for e in t[1::-1]:
...     last = {e: last}
... 
>>> last
{'cat': {'dog': {'bone': 10}}}

```