def digit_sum(n):
    for d in str(n):
        return b

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

Replace this line with your code. 
Can somebody help me to check or correct it? I have struggled few days for this one.


you should first append all digits to your list, then after/outside the loop get the sum of the list and return the total


Thank you. I have solved the problem