the python translation doesn't consider booleans numbers even though they are
there's also javascript logic partially and inconsistently leaked into it, in js there's no integer type (unless counting bigint) and instead there's a number type which is just float.. but the python translation uses int.. it's not clear at all how that should be fixed if it was to be changed.
The problem states that if the arguments are numbers then it can be assumed that neither will be 0. But I am getting a division by zero error in the random tests.
Traceback (most recent call last):
File "/workspace/default/tests.py", line 22, in <module>
test.assert_equals(my_first_kata(a,b),sol(a,b))
^^^^^^^^^^^^^^^^^^
File "/workspace/default/solution.py", line 5, in my_first_kata
return a % b + b % a
~~^~~
ZeroDivisionError: integer modulo by zero
The initial public test that executes when clicking the test button is broken. Actually, it looks like a test for a completely different kata (it is trying to call an add method, so you will get a confusing error about there not being an add method).
To complete this kata, you have to skip pushing the test button and just click the attempt button instead.
This comment is hidden because it contains spoiler information about the solution
the python translation doesn't consider booleans numbers even though they are
there's also javascript logic partially and inconsistently leaked into it, in js there's no integer type (unless counting bigint) and instead there's a number type which is just float.. but the python translation uses int.. it's not clear at all how that should be fixed if it was to be changed.
The problem states that if the arguments are numbers then it can be assumed that neither will be 0. But I am getting a division by zero error in the random tests.
Thanks for that link - learned something new. Very interesting and helpful.
Thanks, I did mine like this and wasn't sure about it.
Interesting observation!
No sample tests for Ruby.
This comment is hidden because it contains spoiler information about the solution
The initial public test that executes when clicking the test button is broken. Actually, it looks like a test for a completely different kata (it is trying to call an
add
method, so you will get a confusing error about there not being anadd
method).To complete this kata, you have to skip pushing the test button and just click the attempt button instead.
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
If it failed, then why did it pass?
This comment is hidden because it contains spoiler information about the solution
This would fail for when the argument is "YX" though.
This comment is hidden because it contains spoiler information about the solution
Loading more items...