def digit_sum(n):

n_sum = 0

```
while n > 10:
n_sum = n_sum + (n % 10)
n = (n // 10)
else:
n_sum = n_sum + n
return n_sum
```

print digit_sum(1234)

digit_returns 10, as shown in error message, but no pass.

Oops, try again. Your function fails on digit_sum(1000). It returns 10 when it should return 1.