Digit_sum


#1


https://www.codecademy.com/courses/python-intermediate-en-rCQKw/0/4?curriculum_id=4f89dab3d788890003000096#


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)


#2

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