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.
Decided to forgo
length = 0
as like you said it does not completely makes sense and asking users to raise exception probably would only distract people from the main task.length > 0
now.By the way, thank you both for the feed back, appreciate it. I'm learning a lot :)
Accidental double comment
Yeah, I get what you mean now. But I still want users to check for when
length = 0
, so I should probably reword kata somehow. Or do you think it should returnFalse
in this case instead?This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
Not sure. I think that given
length = 0
returning0
hooks is okay. Or are you saying thatlength = 0
should not be given as it implies that there is no curtain to begin with?So probably
int()
is just not needed then. I see why it might be confusing.This solution seems to always return
False
ifmaxHook >= 2*length
. Trytest.assert_equals(number_of_hooks(25,50), 2)
Cought that on a corrected kata random test caseChanged the code, I believe it's resolved now
Resolved
This comment is hidden because it contains spoiler information about the solution
Yeah my bad,
L < D
should return2
, outthough myself on that one.As for
L=0
meaning no curtain needs to be hanged,0
seems like a reasonable answer for the number of hooks required. At the same time maybeNone
is more appropriate?I could think of more inefficient ways to do this (and tried one way that fails big number test) so I though mine was prety good (lack of programming knowledge), but you are right after looking at your solution I get what you mean :D. Will think about how to either reword or improve the solution. Or maybe this wording works for the "good enough" solutions.
Loading more items...