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.
I confirm that the typo still exists
print
the inputs, so that you can see them in the console"6 should equal 5"
tells you all you need to know:6
is what your code returned,5
is the expected value.I'm sorry, maybe I wasn't able to explain my issue properly; I have a piece of code that passes a few tests that I run locally, but I'm unable to pass the "hidden" tests of the kata because I receive the message
Ok then, what is the test that fails? How do I debug code that fails to pass a test I don't see?
These tests pass; every other test I can imagine and write passes as well.
just add
print('something')
to your code. Also make sure the code doesn't time out by including something likeif b > 1000: return 'stop'
. This way you will see the printed output.Well, if I can, please tell me how :) I looked for a button that uncovered the hidden tests for quite a long time.
@pochmann: look at my solution, you'll see the thing at the first line of code. ;)
or you need to know the right tools to solve that as a 6kyu. ;) (this kind of problem is pretty generic on CW. Maybe we are too much used to them...)
hint: try to find a way to not generate the useless numbers in the input range (note that this kata wouldn't be so much easier in a language other than python. That should give some hints too. ;)
The point is that you learn how to debug your own code, receiving inputs you don't know about. Here, on CW, you're not on codefight: you can print/see the inputs of the "hidden" tests... ;)
What is the point of having tests that do not cover all the cases covered by random tests? My code fails because of a test I can't see. So I must guess what's wrong without actually knowing what's wrong. It's pointless (also, against TDD).