Why does my code not work? please help



it gives me :Oops, try again. Your function fails on digit_sum(434). It returns None when it should return 11.
and a none in the console

i should be getting a number sum instead, but i'm not sure why it does not work

def digit_sum(n):
    temp = 0
    while n>0:
        temp = temp + n % 10
        n = n // 10
        print (temp)


you print the result instead of returning it (use the return keyword)


oh. thanks! it works now