I have a list of strings consisting of integers, and I am trying to replace them with the sum of their digits. E.g. `nums = ["12","23","33"]` -> `nums = [3,5,6]`

Here is my code:

```
strng = ['12','23','33']

for i in range(len(strng)):
    print(list((map(lambda x:int[x],list(strng[i])))))

```

For the above I am getting a `TypeError: 'type' object is not subscriptable`. It works up until map(), but when I add the list(map(...)), I get this error.

Any ideas how to fix it?

My after this is fixed, my idea is to do the following:

strng = ['12','23','33']

```
for i in range(len(strng)):
    strng[i] = sum(list((map(lambda x:int[x],list(strng[i]))))))

```

Which should replace each of strng with the sum of its digits.
['https://Stackoverflow.com/questions/68807437', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/16510721/']
You can use comprehension, and iterate each digits, convert them to integer, finally pass it to `sum` builtin to get sum of the values.

```py
>>> [sum(int(i) for i in v) for v in strng]
[3, 5, 6]

```
Not really efficient, but try this :

```
strng = ['12','23','33']

def function(strng) :
    my_list = []
    for string in strng :
        my_list.append(0)
        for digit in string :
            my_list[-1] += int(digit)
    return my_list

strng = function(strng)
print(strng)

```