Ad
  • Custom User Avatar
  • Custom User Avatar

    Not a kata issue, it's a problem with your code, read this

    You have to return the recursive call to your function too.

  • Custom User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Custom User Avatar
    1. Please for discussions on a specific kata, use discourse section of this kata
    2. Please read this paragraph of FAQ to see how to properly post to kata discourse. You could remove code from this post to remove spoilers.
    3. Read this paragraph of the troubleshooting FAQ, especially its last bullet point.
    4. Please read this paragraph of troubleshooting FAQ, recreate the failing test case locally in your IDE, and debug through your solution.
  • Custom User Avatar

    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]