Problems with (15.4) - digit_sum exercise


I don't get it, I tried to change the code in various ways but I still get: 'int' object is not callable or 'float' object is not callable errors
Although in PyCharm the code runs just fine. Does it have something to do with the Python version difference - cause Codeacademy is on Python 2.7, right - ?
Does anyone know where's the problem ?
Thanks ^^

def digit_sum(x):
    number = int(x)
    result = 0
    while number != 0:
        result += number % 10
        number /= 10
    return result


HI try to refresh the page bcause I ran your code and it works..



Oh, that's interesting !
All the time I was working in the french version of Codeacademy, but when I switched to English the code worked fine. So the problem is actually in the french version of this exercise.
Thanks for your advice and help ^^


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