This is my code:
def digit_sum(n): total = 0 str(n) for number in n: int(number) total += number return total
I tried hard to fix it but I couldn’t. This is my error message:
Does your digit_sum function take exactly one argument (a positive integer)? Your code threw a “unsupported operand type(s) for +=: ‘int’ and ‘str’” error.
Can someone please help me?