Digit_sum


#1


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


#2

Is there something you'd like to know?


#8

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.