def digit_sum(n): digits= for d in str(n): digits.append(int(d)) b=sum(digits) 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.