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.
3 reasons why I think this approach should not be encouraged and should have 0 on Best Practices:
eval()
can be dagerous, especially if the input comes from an untrusted source. It can execute arbitrary code, leading to potential security vulnerabilities.eval()
can be slower than direct operations due to the overhead of parsing and interpreting the string.f meams that it is f-string and all variabels in it convert to string
This comment is hidden because it contains spoiler information about the solution
Sample tests are not using the test framework properly.
I agree, and you may add even more complex edge cases, like:
Let's go to the U.S.!
(acronym + punctuation)"This is a quote."
(quote + punctuation)4.5 billion years ago
(numbers using dots)Updated description and example tests.
Suggestions:
split(" ")
to count the words, but that gives wrong results with leading/trailing spaces, as it was the case with one of your test cases -- you know,"a b c ".split(" ") = ["a", "b", "c", ""]
@Blind4Basics
First time I see this type of syntaxe with python! :o
Is that some sort of static checking? (or at least dynamic checking?)
Well, me again... ;)
EDIT: possible edge cases to add (or not!) / explain:
"Marie-France"
=> 1 or 2 words?...
,WHAT-THE...!??!!???
(Damn, that would make a nice one, that... ;o )Thank you for the feedback!
I've clarified your mentioned points in the description.
The description is isufficient: