*UPDATED (unsolved)*

I am trying to solve the challenge enclosed in the Hint. It asks to use % or // within a pattern to isolate all of the digits given in a number, and then to add them to a total. Here is the link:

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

I tried to use floor divide to isolate each digit by dividing it by 10 * 3, then, * 2, then * 1, as appropriate. Here is my attempt:

```
numbers = []
def digit_sum(n):
s = str(n)
l = len(s)
if n > 0:
for d in range(l):
number = int(n // (10 * (l - (int(s[d]))))
print number
numbers.append(number)
print sum(numbers)
```

The error reads: *Did you create a function called digit_sum? Your code threw a "global name 'digit_sum' is not defined" error.*

and then

*File "python", line 16*

*print number*

*^**SyntaxError: invalid syntax*

If I delete "print number", the same occurs for the following line.

Any advice helps. Also, if you have recommendations of how to go about the same task using % instead.

*Thanks mtf for all your suggestions!*