Traceback (most recent call last):
File "python", line 8, in
File "python", line 5, in digit_sum
TypeError: unsupported operand type(s) for +: 'int' and 'str'
I really don't understand what I did wrong! Can you guys help me?
Replace this line with your code. def digit_sum(n): total = 0 n = str(n) for i in n: total = 0 + i print total print digit_sum(567)