Ad
  • Custom User Avatar

    The definition of the "parts" help to make the code readable and more simple to maintain (for bug or changes).
    In the real world this is better than the 1-3 lines solutions.

  • Custom User Avatar

    Indeed, you're absolutely right! Nice notice, thank you.

  • Custom User Avatar

    Basing on the documentation (https://docs.python.org/3.5/library/stdtypes.html#str) str() is safe if no value is provided (it returns an empty string) and for other objects.
    Why are you checking the ValueError and TypeError?

  • Custom User Avatar

    I tried to maintain code as readable as possible, especially the "robot search" Regex part. I porpusely avoided to use a single "crazy" string.
    What if tomorrow the "eye" can be a "X" as well as the current "0"?
    What if this happen after 1 year and the poor developer that maintain the code has to understand all the regex?
    I used ony compiled regular exceptions and avoided to "play with strings".

  • Custom User Avatar

    Are you removing lowercase and UPPERCASE vowels?

    "Expected" and "But was" are inverted becauset he test cases are using Assert.Equal() in a wrong way.
    The expected value should be the first parameter, the returned value the second one.
    Example:
    Assert.AreEqual("Ths wbst s fr lsrs LL!", Kata.Disemvowel("This website is for losers LOL!");

    If you use Assert.Equal() in this way you have the right "description" of the failure.