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.
👏
Updated to JUnit 5 and approved.
If you reread the descriptions of the different arguments to the function you should find that some include descriptions of what values are considered valid. This implies what most of the invalid cases are, and the rest are covered by the other part of that paragraph, about the function not being defined.
I'll tweak the wording to try to communicate it more clearly but the relevant error cases are given from the information in the description.
It is not specified what "invalid values" mean in the kata. Input validation without specification is an open-ended question, which boils down to everyone trying to read kata author's mind (which is bad, obviously).
best practice
I think the biggest problem is (almost) everyone can vote.
I consider myself prety much a beginner and have eroniously voted for less efficient code because I thought it was the best. Maybe only users with high kuy score should be able to vote for best practices. Or even better, active people vetted by mods.
fstrings ftw
Approved some time ago
Personally, I believe that the .union(arr2) is incredibly useful here. Wish you nothing but the best. hugs and kisses xox
couldn't agree more, i'm sick of people voting best practice just random stuff, the voting mechanism should be changed
Approved by someone
Back in the old days when many people were completing this kata, the starting code was:
If you edit/fork the kata and look at the "Complete Solution", you'll see the legacy of this format is still in place (it's just in a non-public location).
Most kata writers don't bother changing given variable names, since that's not part of the "problem" we're being asked to solve.
So, yeah, people are right that it shouldn't be
bool
, which is why someone updated the kata to change the starting code toboolean
(which, IMO, is just as bad of a name, since it's still the name for a variable type, even if Python proper never uses it; it's like Hungarian Notation, except it's not just a notation, it's the whole name). But, you should keep kata updates in mind when talking about people's ancient solutions: the ground has shifted.To be honest when I wrote this I'd forgotten about the built-in function as I so rarely use it, but I would probably choose a different argument name with that in mind as I agree it's best to avoid shadowing built-ins.
If I wrote it now I'd probably go for
isTrue
as parameter name but not sure it's as clear...It's not a keyword but a built-in function. And yes, it's a bad idea to use it as a variable name.
bool is not a keyword in Python
If bool is, then you can't use bool in variable names.
Loading more items...