I am trying to fid sum of digits by appending each digit to list and then finding out the sum of the list in some range t …

```
t=input("")
while t>0:
sum=0
q=[]
n=input("")
print sum(int(i) for i in n)
t-=1
```

but am getting an error saying…

```
File "sum_digits1.py", line 7, in <module>
print sum(int(i) for i in n)
TypeError: 'int' object is not iterable
```

can anyone point me as to where the error is …

appreciate the help…