While I agree it can be improved as you said, I consider something as a kata issue if the user can't fix it changing his/her code. In this case, the problem comes from the user returning a different datatype from the expected one, and it can be fixed by the user, returning the expected one.
I would still consider crashing tests a kata issue. If tests want to use the returned value in a non-trivial way, it should be sanitised and not cause a crash.
I get a TypeError no matter what I do, whether I am testing or attempting the solution.
The problem seems to be the "testing" function defined. I get:
Traceback (most recent call last):
File "tests.py", line 18, in <module>
testing(gps(s, x), u)
File "tests.py", line 6, in testing
r = fabs(actual - expected)
TypeError: unsupported operand type(s) for -: 'list' and 'int'
The list type just changes to 'None' if I just return nothing. Can anybody help?
Because there's no need to reinvent the wheel.
I am also lost. What is a decimal representation?
While I agree it can be improved as you said, I consider something as a kata issue if the user can't fix it changing his/her code. In this case, the problem comes from the user returning a different datatype from the expected one, and it can be fixed by the user, returning the expected one.
I would still consider crashing tests a kata issue. If tests want to use the returned value in a non-trivial way, it should be sanitised and not cause a crash.
Well, you're returning a list instead of a number, that's your code's problem, not a kata issue.
I get a TypeError no matter what I do, whether I am testing or attempting the solution.
The problem seems to be the "testing" function defined. I get:
The
list
type just changes to 'None' if I just return nothing. Can anybody help?Reviewed, Forked & Approved. (Honor points goes to you)
Beutiful.
yes and no
It is time to learn boolean :)
🔪
Today i learned: You can do this
im asking why people vote it as cleaver ?
I dont C/P. I am printed, dude...
Loading more items...