Ad
  • Default User Avatar
  • Default User Avatar

    'xrange' is a function in Python 2.x.
    In Python 3.x, use range() function instead.

  • Default User Avatar

    It's still likely to break things downstream because n/i will have a float type rather than int, doing annoying things like producing unwanted ".0" in printed output and str() conversions.

  • Default User Avatar

    Really frustrating. I thought that initially as well and tailored my solution to it. When it was only letters and numbers, it passed. But with the random test cases I got a bunch of bugs, and now i have to write the code all over again( which I won't). all the different test cases should have been specified in the problem description . This is necessary because any one who tries to solve a problem needs to understand what test cases exist to write a solution around them.

  • Custom User Avatar

    Absolutely this ^. Really frustrating spending time trying to complete it only to see my approach was way off just because the instructions were not clear.

  • Default User Avatar

    Completely agree and especially since all the sample tests follow this logic... Would it be possible to either make it clear in the instructions or to include a sample test which makes people understand the string might be a bit more complex than an alphabetical string followed by a numerical string?

  • Default User Avatar

    Note in Python 3 it should be n // i

    The only reason this Python 2 code did not break is that it's only running while n % i == 0, so it happen to be only feeding numbers that divide into whole numbers anyway.

  • Default User Avatar

    NameError: name 'xrange' is not defined
    'xrange' was renamed to 'range' in Python 3 appearently.

    Also I would change n /= i to n //= i to more explicity call integer division, tho I'm not certain it matters since it's only running on modulo 0 stuff in the while loop, but normally it would cause some undesired non-integer results.

  • Default User Avatar

    How's it not a kata issue? I too was surprised a 4 kyu was so straightforward and easy. Searching for katas with "too easy" in comments is a good way to rank up quickly I guess, if nobody's willing to fix the scoring.

  • Default User Avatar

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

  • Default User Avatar

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

  • Default User Avatar

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

  • Custom User Avatar

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

  • Default User Avatar

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

  • Default User Avatar

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

  • Loading more items...