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.
It's also doing too much work.
Guido hates the return type being dependent on argument values. That's why even 8/2 is 4.0 in sane Pythons, not 4. Although, of course, there is an exception. Can you tell what it is? :-]
This comment is hidden because it contains spoiler information about the solution
You mean that you'd rather have
abs (x1-x2)
instead ofabs(x1-x2)
. That's right, it would be much more natural in Haskell. In fact, I think that's what I wrote, but I think that codewars ignores white space when grouping solutions.*Edit*: Sorry, completely misinterpreted your comment. I've added an issue to the kata and will add the
0
test as soon as #163 gets fixed.Hello Chobbes,
As Darnor wrote, the description specify that if the method recieve an empty string or null, it should return
"Invalid String!"
, that's why you should validate against null or empty strings.Because
""
is considered as an empty string. See the description:Also, you should validate that the given string is not empty or null. If so, the method should return: "Invalid String!"