4. Digit sum - It's correct but it wont let me pass!


this is my code

def digit_sum(n):
    num_string = str(n)
    list_sum = []
    total = 0
    for digit in num_string:
    for i in list_sum:
        total += int(i)
    print total


and this is my error

Oops, try again. Your function fails on digit_sum(434). It returns None when it should return 11.

and this is what is in my out put screen


what do I do?
i've refreshed the browser and it still wont pass.


If your function does not return something it will return None, so change it so you return the total instead of printing it out.


thank you very much! that worked perfectly