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.
No, very bad practice.
In case of error the function should raise (or propagate) an exception, not return a string.
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
Nice!
You don't get bonus points for hallucinating new problems, so why bother?
This is called exception management. If you expect an specific error type, you can do this to avoid your program from crashing all the way. It is especially useful when you have lots of lines of code and this portion is not vital, so the rest can continue executing without it if the expected error happens.
.lower() works in this case ???
good preactice
...so?
My bad! I had the exact same results when I verified my solution with Chat
do you realize this solution predates chatGPT by many years ? this kata is from 2014
Classic ChatGPT... ; not the best way to learn :(
you think you're being a solid dev by not trusting user input (which is good, don't get me wrong), but instead of raising the value error to the caller you hand them back a string when it's implied that they'll get back an integer, lololol.
lol, not really , sometimes a code does not have to pass for everything and that may end up defeating the purpose of the code
I think it's clever so I vote clever :D
Since I don't really have a proper reference for what 'best practice' would look like.
Clever means for me that it is an approach I couldn't even conceive of,
or that combines aspects of programming in a way that is new to me.
Loading more items...