• Custom User Avatar

    Occam's razor suggests your outside environments to not have the same tests as on Codewars.

  • Custom User Avatar

    returns its multiplicative persistence, which is the number of times you must multiply the digits in num until you reach a single digit.

    Your code doesn't do that. Also, returning inside the loop like that, the code inside it runs only once, because returnexits the function.

  • Custom User Avatar

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

  • Custom User Avatar

    If you print out messages about what you're doing in the code, you could then read those messages to get an idea of what happened. You'd probably want to start with what the input and output was, consider whether that's indeed wrong and then start looking what happened between those.

  • Custom User Avatar

    Maybe, but without seeing your code, nobody can tell for sure. Read this: https://docs.codewars.com/training/troubleshooting

  • Custom User Avatar

    I'm just starting to learn how to code. The test for this challenge show me this at the end.

    Test Passed: Value == 3
    Expected: 0, instead got: 4
    Test Passed: Value == 2
    Expected: 4, instead got: 9

    I don't understand what went wrong with my code. I want to ask for a hint, maybe I need to do an if statement to fix the first error and another loop inside of the loop I already have to fix the second error. I just trying to fix this but I don't understand exactly how.
    Thanks in advance for your help.