as you can see from the image, the code produces the right result.
If i put the same line of code under a "def" it wont work. Why?
Why do I have to translate the n to str?
why do i have to translate after to int?
Why not directly to int?
And whats the deal with positive int?
n = 863 n = str(n) total = 0 for i in n: total += int(i) print total