Ad
  • Custom User Avatar

    we want to find a positive integer k

    Your code returns floats, it's your code's problem, not a kata issue.

    making it impossible to finish this Kata

    Python Completions 26001

    The tests are fine.

  • Custom User Avatar

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

  • Custom User Avatar

    You can print 'n' and 'p'

  • Custom User Avatar

    I have passed all the test casess except for the 4th test .
    the output says :-1 should equal 9

    Is there any way to know the parameteres passed to the function for this test. It my help me to resolve the issue.

    Any inforamtion is much appreceiated.
    Thanks in advance

  • Custom User Avatar

    This teaches some valuable lessons. Unfortunately, it seemed to be primarily through frustration. Not the best teaching method. Some more rounded sample tests hinting at the esoteric quirks being highlighted would be a large improvement. Where there is a whip there is a way, but gentle encouragement is a better choice IMHO.

  • Custom User Avatar

    I like it. Perhaps just a little to clever for its own good? As code-fu it's great though!

  • Custom User Avatar

    I like your clarification of variable names too!

    I hadn't concidered Arphox's comment at all (thinking they were givens I couldn't change), but they're right. Unless stipulated in some sort of weird requirement, the parameter names are up to me as well.

    Either way, such additions will be removed by optimizations, so adding code like this to benefit readability is always a great idea.

  • Custom User Avatar

    I actually like this solution very much.
    In the real world, code efficiency is FAR less important than readability unless the customer raises a defect that it's too slow. Seriously.
    I glance at this in passing and know it's something to do with number parity.
    The fancy solutions are better if speed is a concern, perhaps.
    I'm long past my days where I had to produce an esoteric single-line solution all the time.