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.
@william01424 no they straight up didn't even test the example in the description. They've shown this, that's why I can say that.
In general around here, when somebody says it works in their IDE, the biggest difference isn't the environment but in the person running the test. When running it here, it is the kata author/translator who ran the test, when you run it in your IDE, it's you. That's... always going to be the more likely cause.
If I run 3.6 code I generally expect it to do the same thing on 3.8/3.9 unless there's a bug in the code. It's a minor version bump, things don't often break that way and it shouldn't be your first guess unless you have clear indication of it. For example, you could download 3.6 and install it next to your 3.8 and run it in both. You would then be the one adiministering the tests for both (making that part the same) and you would only be changing the interpreter. That's better science. (Don't change multiple things because then you can't tell what made the difference, that's probably some sort of principle)
I can't tell you you're wrong :P but in terms of what's likely, yeah. That. ^
My suggestion would be to make sure do your best to replicate the exact same tests run them the same way. That might not be easy and that's okay, but for anyone to tell you anything more than that you'd have to give more information about what happened. (the easiest way to do that accurately would be to share your code and say which test case it fails for, and maybe also show how you tested that yourself locally)
Oh and. If you have "the same question/issue" then you're saying that the same answer applies. You'd have to add information to get a different one.
This might be helpful to figuring out how to work out what's up on your own: https://docs.codewars.com/training/troubleshooting/
I have a similar issue, with a similar style question. I think he means that when he is running the same tests in his IDE, it returns the correct results. But when the same code is inputted into CW, some tests fail.
Not sure if this is because your IDE is python 3.8 and CW is running the question in 3.6?
You're saying this before having tried all the examples in the description.
Even if you did try them all and they all passed and the real tests do not - the same applies there. Test the thing that fails, not the thing that succeeds.
This comment is hidden because it contains spoiler information about the solution
Please use that kata's Discourse: https://www.codewars.com/kata/541c8630095125aba6000c00/discuss/python and mark your post as having spoiler content when it has code like this. Here it can't be marked and it is offtopic.
Hello internet friends,
Any help with the following Python problem would be greatly apreciated. In my own IDE this seems to return the correct result but fails on the test. Thank you.
This is the problem:
Digital root is the recursive sum of all the digits in a number.
Given n, take the sum of the digits of n. If that value has more than one digit, continue reducing in this way until a single-digit number is produced. The input will be a non-negative integer.
Examples
16 --> 1 + 6 = 7
942 --> 9 + 4 + 2 = 15 --> 1 + 5 = 6
132189 --> 1 + 3 + 2 + 1 + 8 + 9 = 24 --> 2 + 4 = 6
493193 --> 4 + 9 + 3 + 1 + 9 + 3 = 29 --> 2 + 9 = 11 --> 1 + 1 = 2
and here is my soloution :
def digital_root(n):