Ad
  • Default User Avatar

    The tests are passing the 'base'-list as a reference to your function, which means that the 'base'-list will be modified if your function doesn't copy it before usage.

  • Custom User Avatar
  • Custom User Avatar

    Read the error message, it tells you with which input your code fails:

    Traceback (most recent call last):
      File "/workspace/default/src/codewars-test/codewars_test/test_framework.py", line 111, in wrapper
        func()
      File "tests.py", line 8, in __
        test.assert_equals(title_case(''), '')
      File "/workspace/default/solution.py", line 4, in title_case
        ...
    IndexError: list index out of range
    

    Not a kata issue.

  • Default User Avatar

    btw, I get an index error when I attempt it

  • Default User Avatar

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

  • Custom User Avatar

    Here's an example of a test:

    test.assert_equals(bool(search(regex, 'fjd3IR9')), True)
    

    Your code should contain only one line: assignment to regex variable.

  • Default User Avatar

    I am having the same problem as jgarwin95. My code does what it says in the description. After defining a = [1, 2, 3, 4], calling a[0] returns 1 and calling it again returns 2 (since a[0] is deleted after the first calling). However, I get an error saying '1 should equal 2' for the first case, and '2 should equal 4' in the second case. Any ideas on why this might be the case? If you need to see my code, let me know and I can copy and paste it.

    And just to see what happens, I redefined my code so that when a[index] is called, it returns (and pops) a[index+1], i.e the output would be 2 in the first case. However, now the test case gave an error saying '2 should equal 1' !!!!

  • Default User Avatar

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

  • Default User Avatar

    oh yeah, lol thanks

  • Default User Avatar

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

  • Default User Avatar

    How can I see the input parameters of Test 0? That's the only test my code doesn't work for. The 'Sample tests' box in the bottom right only show the parameters for Test 1 & 2.

  • Custom User Avatar

    I don't think it's possible :/ Because it's marked as spoiler, only those who solved it will be able to see it, so it's not a big deal. But discourse section is more for discussing issues or problems with code, description, etc. Just so you know for future :P

  • Custom User Avatar

    I'm sorry, i didn't know, how can i remove it?

  • Custom User Avatar

    Don't post your solutions in discourse! It's forbidden. Use the solutions tab.

  • Custom User Avatar

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

  • Loading more items...