Ad
  • Custom User Avatar

    Oh, right. Thanks !

  • Custom User Avatar

    I keep getting:

    Traceback (most recent call last):
    File "main.py", line 5, in
    test.assert_equals(to_camel_case(''), '', "An empty string was provided but not returned")
    File "/home/codewarrior/solution.py", line 9, in to_camel_case
    word = word[0].upper() + word[1:n]
    IndexError: string index out of range

    But in the REPL my function works just fine for all the test cases.

  • Custom User Avatar
  • Custom User Avatar

    My recursive C++ solution seems to be working for the sample tests but fails when I'm pressing the "attempt"...
    Anyone who succeeded solving it recursively in any language?

  • Custom User Avatar

    I'm getting this error, after using an answer that works in my python REPL.

    Traceback:
    in
    in
    TypeError: can't multiply sequence by non-int of type 'str'

    I did it with two different ways, and I still get it...What's wrong?

    EDIT: I've got these errors when I tried to do it in JS. I think they should be mentioned in the description.

    n must be a number - Expected: false, instead got: NaN
    ✘ n must be a value - Expected: false, instead got: NaN
    ✘ n must be an integer - Expected: false, instead got: 6.499800000000001
    ✘ a value of n greater than 0 is required - Expected: false, instead got: 0
    ✘ a positive value of n is required - Expected: false, instead got: 45