It's great that you ask for help and provide something to use: the error messages. They tell you that in line 11 you are trying to access a value at an index that is invalid for the container from which you are trying to access. I can't tell whether it is jmin that cannot be found in snail_map or whether i cannot be found in snail_map[jmin], but that is how you can figure out what's wrong. I hope this helps you debug. Questions?
please know that you should not post code without a spoiler tag (I have just added the tag to your comment) otherwise anyone who has not solved the kata can also see your code
if you do post code, use proper markdown to preserve indentation
From the code I can see, wrong datatype and a string is not an instance of int, so your code returns None. There is no long type in Python either (at least since 3.x). The function's name should be descending_order instead of ordenar too.
Read Note 2 at the end of the description, also the error message you get.
Yes.
You can see there also the test it fails:
test.assert_equals(snail([[]]), [])
It's great that you ask for help and provide something to use: the error messages. They tell you that in line 11 you are trying to access a value at an index that is invalid for the container from which you are trying to access. I can't tell whether it is
jmin
that cannot be found insnail_map
or whetheri
cannot be found insnail_map[jmin]
, but that is how you can figure out what's wrong. I hope this helps you debug. Questions?This comment is hidden because it contains spoiler information about the solution
Got it already. Had to add 'break' statement after commands
Hello @Jan Necinski
thank you
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
None, lol. it literally passed all the tests
Start by printing the input to see which input makes your code fail.
same bug here :/
This comment is hidden because it contains spoiler information about the solution
didn't know about the function name requirement, thanks!
From the code I can see, wrong datatype and a string is not an instance of int, so your code returns
None
. There is nolong
type in Python either (at least since 3.x). The function's name should bedescending_order
instead ofordenar
too.Loading more items...