Ad
  • Custom User Avatar

    3 reasons why I think this approach should not be encouraged and should have 0 on Best Practices:

    1. Security risk: Using eval() can be dagerous, especially if the input comes from an untrusted source. It can execute arbitrary code, leading to potential security vulnerabilities.
    2. Hard to Debug: Errors in dynamically evaluated expressions can be harder to trace compared to explicit conditional branches.
    3. Performance: eval() can be slower than direct operations due to the overhead of parsing and interpreting the string.
  • Custom User Avatar

    f meams that it is f-string and all variabels in it convert to string

  • Custom User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Custom User Avatar

    Sample tests are not using the test framework properly.

  • Custom User Avatar

    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)
  • Custom User Avatar

    Updated description and example tests.

    Suggestions:

    • add random tests, or at least more tests in random order, and display the number of expected symbols/words/sentences in those tests
    • also fix your solution (and the possible solver function for random tests), because you use 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", ""]
    • add more edge cases and explanations as suggested by @Blind4Basics
    • perhaps rename kata to "readability"
  • Custom User Avatar

    First time I see this type of syntaxe with python! :o

    Is that some sort of static checking? (or at least dynamic checking?)

  • Custom User Avatar

    Well, me again... ;)

    • that's way better but you "have to" put the example from the description in the sample tests (otherwise it's not useful/to the warriors to do it, and that's not being nice toward them).
    • not enough tests! And would be better to have random tests too.
    • my solution passed the tests but still does not work properly with the example of wiki, for example.

    EDIT: possible edge cases to add (or not!) / explain:

    • "Marie-France" => 1 or 2 words?
    • multiple ponctuation signs..., WHAT-THE...!??!!??? (Damn, that would make a nice one, that... ;o )
  • Custom User Avatar

    Thank you for the feedback!

    I've clarified your mentioned points in the description.

  • Custom User Avatar

    The description is isufficient:

    • what are the sentences delimiters definitions? (meaning, the one you use!)
    • sentences counting: what about acronyms with dots? (I just found that using the sentence of the wiki example, trying to debug my code)
    • sentences counting: what about the quotations?
    • you should explain at least the example tests. Currently, if someone has an algorithm that does not return the good value, there is no way to find what is the problem.