Hey what is going on here?


In Practice makes Perfect 4 .digit_sum I get this error message:
Oops, try again. Your function fails on digit_sum(434). It returns None when it should return 11.
And the funny thing is that I get the result 11 when I put 434 in the function.
Here is my code, I don't have any syntax errors in it .

def digit_sum(n):
 for i in range(len(x)):
 for j in k:
 print z



You have to return calculated value, not print it out :slight_smile:


Today I went from 30% to 67%, I think I need a break for today.
Thanks for the answer though.


Even in case of basic courses, like this one, it is usually a good idea to implement study blocks, 50 minutes of learning with a 10-minute break is a good scheme.

You're welcome.


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