Replace this line with your code. def digit_sum (n): s=0 lis=  while n!=0: digit = n%10 lis.append(digit) n = n // 10 # removing the rightmost number print lis for i in lis: s+=i return s
Is there something you'd like to know?
This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.