Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
You're not returning anything and you're redeclaring the variable upon each loop ~~
Yes. But as you see, you could solve it from your code, the tests were ok.
This comment is hidden because it contains spoiler information about the solution
If you get that error, you didn't even defined the function.
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.
I replied to you in this thread: https://www.codewars.com/kata/57e3f79c9cb119374600046b/discuss#5f369e91527185001e48f606
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.
I tried it as you advised, but the error I got does not tell me anything
"NameError: name 'hello' is not defined"
So if there's no problem with my code since it checks what should be checked than how can this not be a problem with kata?
It IS a kata issue, even if your code checks for an emtpy arg it still raises the same error.
So why is my code not working? It is checking for empty argument, as you can see it shoudl return 'Hello, World!' if there's no argument passed so it should work just fine.
No, it's not kata problem. Really, it's not. Seriously. All the tens of answers below which say it's not a kata problem are true. Really really.
Because checking in your code is too late. Error occurs at the moment the function is called (at the calling site), before your check even happens.
Serious question though: did you try to call your function locally, in your IDE, in the same way the test suite calls it? something like:
Try this and you will see your solution does not work.
So why do I get the same error even though my code checks for empty argument?
.
Loading more items...