Ad
  • Default User Avatar

    can't be modified

  • Custom User Avatar

    Returning a single character string just for the case when length is 1 is a horrible idea.

    (I know of a kata author which does this lots of times, and that's just horrible.)

    Though, of course, the most natural way is to return a string that has all the characters joined together. That eliminates all the possible ugliness that might happen because of these.

  • Custom User Avatar

    RTFM: "returns an array of the repeated characters"

  • Custom User Avatar

    That's a newbie mistake, so for all purposes it's out of the question. This isn't an 8kyu, and we shouldn't be that hand-holding to people.

  • Custom User Avatar

    What's the problem here?

    You're just throwing a failed test case out without mentioning what you did, or why is that something that needs to be addressed, or how is that so. That's... not helpful at all.

    And the expect result is perfectly correct, so it makes like negative sense.

  • Custom User Avatar

    @marbiru FYI, the problem there isn't that the expected result has a trailing .0. It's that the second element in the attempted solution is off by 4. I don't think this is something that needs troubleshooting, but it's hard to say without seeing @camoneill25's code.

  • Custom User Avatar

    Really sorry -- I also tried figuring out how to int() both solutions so that they would equalise even with different rounding methods but couldn't get it to work –– if any pythonistas could lend a hand that would be awesome, I'm not sure how to troubleshoot this

  • Custom User Avatar

    ok, apparently Python doesn't have a Deep Equals, I was assuming there was an analogy to javascript that doesn't actually exist. Can anyone with Python experience help me troubleshoot this? Maybe the problem is actually with round and forcing the answer to be an integer and not a float, I don't know.

  • Custom User Avatar

    Thanks so much, that's really helpful. I don't know much python but I guess we need some kind of Deep Equals here, let me look at the docs and see if I can find it.

  • Custom User Avatar

    I just corrected the kata a few minutes ago so migth have still been in process when you solved it! Really glad to hear it's working now though, and thanks for letting me know