Ad
  • Custom User Avatar

    Fixed this

  • Custom User Avatar

    Very nice exercise! It made me to create a monty hall mini-game.

  • Custom User Avatar

    I suggest to include test with space at the beginning (python version) at least. While in description is said, that string can only start with uppercase ascii, tests proved, that it's necessary to count with case when string starts with space. Still i voted it up. Great test not only for programming abilities.

  • Custom User Avatar

    Naruto0 & anter69 are correct. The Python test cases should look like this:

    test.assert_equals(shifted_diff("eecoff", "coffee"), 4)
    test.assert_equals(shifted_diff("Moose", "moose"), -1)
    test.assert_equals(shifted_diff("isn't", "'tisn"), 2)
    test.assert_equals(shifted_diff("Esham", "Esham"), 0)
    test.assert_equals(shifted_diff(" ", " "), 0)
    test.assert_equals(shifted_diff("hoop", "pooh"), -1)
    test.assert_equals(shifted_diff("  ", " "), -1)
    

    PEP8:
    Function names should be lowercase, with words separated by underscores as necessary to improve readability.

    mixedCase is allowed only in contexts where that's already the prevailing style (e.g. threading.py), to retain backwards compatibility.

  • Custom User Avatar

    I confirm: in python the test cases look for shiftedDiff while the final tests look for shifted_diff. Please fix

  • Custom User Avatar

    "You can't convert binary to decimal and vice versa" i assumed that i can't use builtins for it, but can i write my own func? Please make it clear for me. Thanks

  • Custom User Avatar

    Thanks for the feedback, and good if you liked it!

  • Custom User Avatar

    I didn't know what barycenter is either. Thank you for this mathematic kata!

  • Custom User Avatar

    You should correct the tested method name(shiftedDiff) to match method name(shifted{underscore}diff) or vice versa. Unless adjusting the test code is part of the exercise. :)