https://www.codecademy.com/courses/python-intermediate-en-rCQKw/0/4?curriculum_id=4f89dab3d788890003000096#

I am trying to figure out how to get the digit sum using primarily modulos and floor division... I have figured out how to get the digit sum for "less than ever factor of ten" (n<10000 sum=) but to combine it into a unified function is troubling me. Here is what I have:

def digit_sum(n):

```
if n<10:
sum=n%10
return sum
elif n<100:
sum= (n%10)+(n//10)
return sum
elif n<1000:
sum = (n%10)+((n//10)%10)+((n//100)%10)
return sum
elif n<10000:
sum = (n%10)+((n//10)%10)+((n//100)%10)+(n//1000%10)
return sum
elif n<100000:
sum = (n%10)+((n//10)%10)+((n//100)%10)+(n//1000%10)+(n//10000%10)
return sum
```

Obviously if I won't be able to "elif:" faster than the computer can think of large words. Does anyone know how I can code (sum+=((n//10**x)%10)

Ideas:

Count *=10

m=len(str(n)

I dont know, help me out

`Replace this line with your code.`