Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
.
Not a kata issue, it's a problem with your code, read this
You have to return the recursive call to your function too.
This comment is hidden because it contains spoiler information about the solution
Hi, I have an issue with "Sum of Digits / Digital Root" question, I believe my code is correct, but it won't let me through (says "None should equal 6"), my prints are showing I'm reaching exactly that, would appriciate your input :)
def digital_root(n):
str_num_arr = split_num(str(n))
print(str_num_arr)
sum = 0
for num in str_num_arr:
sum = sum + int(num)
print(f"sum is now {sum}")
if len(str(sum)) == 1:
print(f"len is now 1 for {sum}")
return sum
else:
print(f"sum len is different than 1, sum is {sum}")
digital_root(sum)
def split_num(num):
return [digit for digit in num]