The code has been bugging me for hours and I have made several abortive efforts trying to make the code work.

What I would like my code to do is the following:

Two inputs, 'numerical\_representation' and 'names' is entered into console.
Then, certain number of elements in 'names' will be summed according to the value in the numerical representation.

```
>>> numerical_representation = (4, 6, 5, 11)
>>> names = (4, 16, 10, 17, 4, 15, 6, 4, 14, 7, 17, 9, 6, 27, 9, 1, 12, 0, 8, 20, 3, 0, 0, 4, 4, 3)

```

for example, since we first have 4 in 'numerical representation'
4, 16, 10, 17 in 'names' will be added and return 47.

then we have 6 in 'numerical representation' the next consecutive elements 4, 15, 6, 4, 14, 7 in 'names' will be added and return 50.

In the end, my goal is to return the 'value\_list' as
[47, 50, 68, 55]

Below is what I have so far.

```
value_list = []    
for i in numerical_representation:
    sum_value = sum(names[:i])
    value_list.append(sum_value)
return value_list

```

however, this would return [47, 66, 62, 106]. I believe this is happening because the for iterator keeps iterating from the beginning of the 'names'.

How should I proceed?