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'm assuming that this is in python. We're going to use the example you are having issues with to help understand what's going wrong. The word you are failing is
Test
.There are 2 things wrong with your code:
The if/else statement in the first line doesn't do anything. It can be completely removed.
The last line has
return s[evenslice:slicelen]
. In other words it is:return s[PositionLeftOfCenter:PositionCenter]
. So in our exampletest
, this would bereturn s[1,2]
. Now that may look good, but you have to remember that when slicing an array the lower bounds are inclusive, and the upper bounds are exclusive. So our examples[1,2]
would return what's in position 1, but not 2. In other words, it would returne
. So to get it to also return the s, you'll need to uses[evenslice:slicelen+1]
.Let me know if you are still having issues. I ran your code with the above changes and everything runs fine.