I found an interesting problem on https://www.codewars.com/kata/5a15a4db06d5b6d33c000018:
Implement a function to calculate the sum of the numerical values in a nested list. For example :

```python
sum_nested([1, [2, [3, [4]]]]) -> 10
```

I tried it in Python, but could not do it. Can you solve it?
def sum_nested(L):
    if L == []:
        return 0
    if type(L[0]) == int:
        if len(L) == 1:
            return L[0]
        else:
            return L[0]+sum_nested(L[1:])
    else:
        return sum_nested(L[0])+sum_nested(L[1:])
    
    #the sum of every numerical value in the list and its sublists