Invisible Syntax Error


def digit_sum(n):
    result = 0
    for n in str(n):
        result += int(n)
    return result

It gives me an error saying that "def digit_sum(n):" is improper syntax.
I've looked function declarations up, and that's perfect python syntax, so does anybody know what's going on?


Hi try to refresh the page..


did you try to change the n variable

your code works , try what @wizmarco say