why isn't that working

```
nums=[]
def digit_sum(x):
if len(str(x))>1:
a=str(x)
for char in a:
nums.append(int(char))
print(sum(nums))
else:
return x
```

why isn't that working

```
nums=[]
def digit_sum(x):
if len(str(x))>1:
a=str(x)
for char in a:
nums.append(int(char))
print(sum(nums))
else:
return x
```

from the instructions:

Write a function called digit_sum that takes a positive integer n as input and returns the sum of all that number's digits

if i now want the digit_sum of 434, nothing gets returned.

Also, for validation the function will be called several times (not the whole script) so place `nums = []`

inside your function

It turns out , it was the "print" statement that confused me .

I appreciate your help .