4. digit_sum Invalid syntax


#1



i m getting invalid syntax error here


def digit_sum(n):
while(n>0):
(
y = n%10
k=k+y
n=n//10
)
print k


Replace this line with your code.


#2

Two things don't look right. The parens, which are not valid; and, k = k + y, given that k does not have an initial value.


#7

Hi. I have near the same code as your, and i receive the message "Your fonction missed on 434 because your fonction indicate "int" object is not callable." So I copy your code , ans i still receive the same message. I hope you can tell me why. Thank!


#8