Ad
  • Custom User Avatar

    Yo, i'm getting a strange error on this.
    I'm pulling the last char of the String using the index s[-1]
    but i got a string index out of range error.
    I'm assuming that this means it's testing using a null or empty string at some point, which is kind of cheeky.
    One could assume that you'll always be passed a string with Something in it right?

    I know, i know. validate your inputs. But still, after passing all tests and still getting an error, it's a bit frustrating.

    -traceback below-

    Traceback (most recent call last):
    File "tests.py", line 17, in
    test.assert_equals(remove(inp), exp)
    File "/workspace/default/solution.py", line 2, in remove
    if (s[-1] == '!'):
    IndexError: string index out of range

  • Custom User Avatar

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