## This is my code :

## def digit_sum(number):

total=0

for x in range(len(number)):

total=total+int(number[int(x)])

return total

number=raw_input(“Please enter a digit so we can add as per Instructions :”)

print(digit_sum(number))

i) which works, produces the correct answers for all integers entered, like 0,11,123,999999, however there is an "error at the bottom

-> Does your digit_sum function take exactly one argument (a positive integer)? Your code threw a “object of type ‘int’ has no len()” error.

ii) I have tried it in an "open environment like pythonanywhere dot com … no issues.

*

Can someone explain to me what the compiler/interpreter is trying to tell me ?

Thanks.

Marc

REF : https://www.codecademy.com/courses/learn-python/lessons/practice-makes-perfect/exercises/digitsum?