Ad
  • Custom User Avatar

    This one is actually having lowest complexity compared to all better rated solutions!

  • Custom User Avatar
  • Custom User Avatar

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

  • Custom User Avatar

    Yes. But as you see, you could solve it from your code, the tests were ok.

  • Custom User Avatar

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

  • Custom User Avatar

    If you get that error, you didn't even defined the function.

    def hello(name):    # you need to do some change here too
        pass            # you need to write your code here
    
  • Custom User Avatar

    I tried it and I got "NameError: name 'hello' is not defined", I don't know how that could help me.

    What else can I do? I can only code what my fucntion should do, if the content of my function cannot help with this issue there's nothing left do d, since I cannot modify the test itself.

  • Custom User Avatar

    Please, listen me once again: for the time being, it appears that it is NOT a kata issue. Checking for an empty string in solution IS NOT enough, your solution has to do SOMETHING MORE to account for this case. Your solution is incomplete, that's why it fails.

    Also tell me if you did what I asked you: on your machine, in your IDE, call your solution like this:

    hello( )

    and see if it passes. If it fails, it means you need to add something to it. BUT if it indeed passes on your machine when called in this way (without parameter), but fails on Codewars, then it indeed is kata issue. In such case, we'd ask you to post your solution (hee here how) so we could pinpoint the problem. But for the time being, it seems to us that your solution is invalid, it is missing one special aspect, and it will fail not only on Codewars, but also on your machine, in your IDE, when called without parameter.

  • Custom User Avatar

    It IS a kata issue, even if your code checks for an emtpy arg it still raises the same error.

  • Custom User Avatar

    Please read a bazillion of issues below related to the same problem you have.

    Recreate this test case locally and see how it fails in your IDE:

    test.assert_equals(hello(), "Hello, World!")

    Misplaced line number is related to line in test suite, and not in your solution. Exception is thrown by test suite, in its like 14, because your function cannot by called by it.

    Not a kata issue.

  • Custom User Avatar

    hi,

    Nope, not an issue. This message shows you what call to your function is raising this error. And if you look carefully at the specifications, there is that line:

    ... or says Hello, World! if name is not given (or passed as an empty String).

    So it's your task to handle this (sounds like you need to dig a bit about the different kinds of arguments a function can use in python.)

    cheers,

    PS: "Issue"==dysfunctionning kata. Here that's not the kata but your code that is "dysfunctionning" => use the "question" label.