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.
Exactly, you're supposed to return False for that one.
@Beaxx check my solution here. It's semantically identical to the second ranked best practice submitted by zebulan here.
In zebulan's comments there is discussion regarding how it works and why it's better practice.
So what's better then?
I beg to differ, as bad practice is to modify input in place if not required, not to just pass objects which are mutable.
Pretty anything immutable. Tuple is great.
Its definitely not a problem for kata itself, rather developing bad practice for greenhorns. IMO, for sure.
That could be a suggestion, at best, but I would not call it an issue, otherwise you should flag A LOT of other katas.
And, mh... it is quite debatable: what would you pass in a similar problem?
Passing list as argument to function is kind of antipattern for python in most cases
Last testcase (
test.assert_equals(is_prime(-1), False, '-1 is not prime')
) have nothing to do with prime numbers. Primes is positive by definitionThis really shouldn't be neither "best practice" nor "clever". Memory usage here is insane, doesn't worth any readability (if there's any here)