Question: I have a dictionary like:

```
D = {0: [[' 11', '3', '6', '8']], \
     1: [[' 2']], \
     2: [[' 0', '2734', '394']], \
     3: [[' 1', '1163', '1216', '13', '181', '33', '379']]}

```

Things I want to do:

1. Remove extra list from its value
2. convert each element from its value into integer.

I tried a little like:

> 
> 
> ```
> for k,v in D.items():
>         D[k] = [i.split(',') for i in D[k] int(i) ]
> 
> ```
> 
> 

But it does not work.

Answer: 
Try this

```
for k,v in D.items(): D[k] = [int(i.strip()) for i in v[0]]

```

`v` should be `[[' 11', '3', '6', '8']]` and `v[0]` should be the inner list `[' 11', '3', '6', '8']`.
If each value in the dictionary is a nested list with the same number of nestings, the following list comprehension works (works with your sample data):

```
for item in D:
    D[item] = [int(numb) for numb in D[item][0]]

```