sumDigits = 0 for c in str(1952): sumDigits += int(c) print sumDigits

I understand that line 2 converts the integers 1952 into a string but I do not really understand how the loop sums the digits and returns the correct answer?

any help on this would be great

Thanks.