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.
Thank you. It finally worked after I added an if statement to handle the situation when words is an empty string.
But in that case, how is my code passing all the test cases?
Still facing the same problem. This is what I'm getting:
Time: 662ms Passed: 17 Failed: 0 Exit Code: 1
Test Results:
Basic Tests
Test Passed
Test Passed
Random Tests
Test Passed
Test Passed
Test Passed
Test Passed
Test Passed
Test Passed
Test Passed
Test Passed
Test Passed
Test Passed
Test Passed
Test Passed
Test Passed
Test Passed
Test Passed
STDERR
Traceback (most recent call last):
File "main.py", line 24, in
randtest(30)
File "main.py", line 17, in randtest
test.assert_equals(to_nato("".join(strIn)), " ".join(strOut))
File "/home/codewarrior/solution.py", line 9, in to_nato
ind = ord(words[0]) - 65
IndexError: string index out of range
My code (Python) is passing all the test cases. But it also shows a stderr. So, I can't submit. What could be wrong?
I'm having the same problem. Only one test case failed. I have no idea what I'm doing wrong.