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've approved it, but there was a typo in sample tests which I oversaw (nil instead of None). :/ There's a fork with a fix, as the author disabled contribution. Can you please approve the fork?
Feel free to fork and make other changes.
Thanks,
suic
Solved:
just declare nil before function
Nil is not undefined, what might be the problem here?
I tried to return None,empty list and 0
ruby
nil
<=> pythonNone
correction: the issue is actually that the default version is set to py2 while other versions are available. So just select the good one in the edit panel.
python:
test.assert_equals(find_2nd_largest([1,1,1,1,1,1,1]), nil, 'expected nil')
(lol...)tho:
1 should equal 3333333333333333333334L
-> except that in python 2, that's not an integer that's a long (ok,, I'm nitpicking, here. But what's the point of having this difference only because of the outdated opython version...?)My code seems to try to return 'nil' in all the right cases but "NameError: global name 'nil' is not defined" is generated. Not sure what to do about it.
OK. I can see your comment now. I will refactor the solution. Thanks.
Why doesn't the system let me see the solutions by other members? It does show my solution as valid in "My solutions". It's been about 18 hours now since I posted it.
because there were some typos in the snippet, sorry (I didn't check it before posting x) ).
This one is working in py3.6:
tho, you'll still nee'd to implement the part that will handle the
None
case.Keep getting error with the exception handeling when trying to implement assertFloatArrayEqual into test cases. I just moved to 3.6 so not sure if it is something I am doing wrong or if I am just missing something.
This comment is hidden because it contains spoiler information about the solution
you talk about stuff that isn't written in there. I'm supposed to be in your head? How nice of you...
Initially the error message in my example was
f"Wrong value at index {i}"
(which is why thereiswasenumerate
in my snippet) but such error message would be useless too, as the user would be notified of a single mismatch, but wouldn't see whether there're any more wrong values.And this becomes insignificant because
actual
andexpected
arrays are shown together with theX should be approximately equal to Y...
message.go for it.
Loading more items...