n = 1234def digit_sum(n): a = 0 s = [ int(i)for i in str(n)] print s for i in s: a += i return aprint digit_sum(n)git
>>it
[1,2,3,4]di
10return