Ad
  • Custom User Avatar

    Just a heads up I failed a random test and then passed when I resubmitted without changing anything in my code, suggesting there may be an issue with the random tests. I failed on inputs (3, 3, 40??), I'm sorry I didn't save it because I was wxpecting to fail again and troubleshoot from there. Anyway, I would look at what happens when s1==s2 and ensure everything is defined/explained clearly.

  • Custom User Avatar

    If you're still struggling with this one:

    how does your solution handle invalid inputs(according to the prompt)?

  • Custom User Avatar

    Check your conditions. I had this issue because I wasn't dealing with the inputs correctly per the prompt. Once I cleaned up my conditionals it passed without issue.

    Not sure if this is what's happening to you, but just wanted to mention since it's a similar result.

  • Custom User Avatar

    Here's a quick breakdown comparing:

    x = y

    x = y[:]

    x = y.copy()

    https://www.programiz.com/python-programming/methods/list/copy

  • Custom User Avatar

    I believe it's because when you run the full test suite it randomly generates a new alpha dictionary, but the sample tests are still based on the fixed basic alpha. When you run the full test suite, it actually calculates using the new, random alpha, and that's why you passed when it came to the full test suite.

    It's just a bug in the kata caused by making alpha a global, preloaded variable instead of a parameter (as it probably should have been). If it causes any problems, you can get around it by resetting the alpha at the beginning of the sample test suite.

    (sorry, i know this is an old post, but i'm also leaving this here for anybody having future difficulties with this kata)

  • Custom User Avatar

    Added a fixed test to all languages just in case.

  • Custom User Avatar

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

  • Custom User Avatar

    1 year later and I'd like to bump this. I'm very curious to know what of my solutions have been upvoted so I can get a better idea of what other programmers think is good in my code.

  • Custom User Avatar

    read the docs.

    wait... that's actually an issue, apparently...

  • Custom User Avatar

    Did you ever figure this one out? I'm getting the same error and I have no idea what it means.

    edit: actually, I'm getting it before the second "Base clsas check", but it's the same TypeError.

  • Custom User Avatar

    Can someone unpack this? How does this create the zigzag?

  • Custom User Avatar

    3 years later and I had to come to the comments to figure out what type of answer this kata was looking for, I'm glad your post was here.

  • Custom User Avatar

    I don't know what happened. When I tried the sample tests I failed every one, but when I clicked Attempt I passed them all. I think something is broken in the tests for python.

  • Custom User Avatar

    {'JGEVB': 1, 'OUDCN': 2, 'MXLAS': 3, 'ZWTYP': 4, 'RQIHF': 5}

    This was my random alpha, you'll notice K is the letter that was skipped. If you add up the letters of "Luke Skywalker" that exist you get 29. But the test says the correct response is 41. I keep failing tests, but when I add up the example from the random alpa given it matches what my code outputs, not what the expected result is. What am I missing?

  • Custom User Avatar

    Given it's Python you're talking about too:

    def comp(array1, array2):
        print(array1, array2)
        # your code here
    
  • Loading more items...