Ad
  • Default User Avatar

    it's probably because you're trying to split a string that has space on it's end so it gives you something like that:
    "rona ".split(' ') ==> ['rona', ''],
    and you're probably pulling dictionary[''] which raises an error.. that was my case anyways
    i just trimmed the spaces on the end of the morseCode (morseCode.strip())
    good luck

  • Default User Avatar

    You're the man bro
    I figured the problem as I saw the test case as you said.. thanks.

  • Default User Avatar

    I keep failing the 10th test case without actual reason..

    Test Results:
    Example from description
    Test Passed
    Basic Morse decoding
    Test Passed
    Test Passed
    Test Passed
    Test Passed
    Test Passed
    Test Passed
    Test Passed
    Test Passed
    STDERR:
    Traceback:
    in
    in decodeMorse
    KeyError: ''

    whatever I tried on my IDE works just fine.. can I get the 10th test case? 'cause it's working fine and I don't wanna forfeit..

  • Default User Avatar

    I pass all the tests on python except..

    Test Results:
    Example from description
    Test Passed
    Basic Morse decoding
    Test Passed
    Test Passed
    Test Passed
    Test Passed
    Test Passed
    Test Passed
    Test Passed
    Test Passed
    STDERR:
    Traceback:
    in
    in decodeMorse
    KeyError: ''

    whatever I tried on my IDE works just fine.. can I get the 10th test case? 'cause it's working fine and I don't wanna forfeit..

  • Default User Avatar

    you could have created the dictionary with a loop instead

  • Default User Avatar

    that's good to know, thanks!