Please let me know where I am going wrong.

I am getting the following error:

"Traceback (most recent call last):
File "python", line 9, in
File "python", line 7, in digit_sum
TypeError: unsupported operand type(s) for +: 'int' and 'str'"

Replace this line with your code. 
def digit_sum(n):
    n= abs(n)
    n= int(n)
    n= str(n)
    n.split(" ")
    for i in n:
        return sum(i)


This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.