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.
Python new test frameworks to be used.
Not declaring variables is bad practice
As noted before (there's even a link in the description) this is an exact duplicate of http://www.codewars.com/kata/reverse-polish-notation-calculator/
Only difference is this have the "^" operator (which would actually make this the "hard" one).
For the python version, I feel that "Number" is a little too generic (int? float? Decimal from decimal module?) It would be nice if the description specified the type of output and the tolerance for representations like float.
I'm getting the same with my JS solution. I'm guessing python random tests (or the reference solution) have some flaws (maybe that's why it's in beta). Luckily JS has no random tests :D
This comment is hidden because it contains spoiler information about the solution
global variable...
Ain't that a beauty!
Python (at least) - int vs float division should be tested in the fixed final tests, because you can easily pass the random tests with a wrong implementation; add e.g.:
Alright guys, we found a mathematician.
Ruby 3.0 should be enabled.
.
[Ruby] Added some random tests with avoiding overflow or division by zero
I also feel it's a duplicate. I used the same solution for both, with the addition of the check for
^
in this one. The other one is also a postfix string with spaces between all operator/operands.I have solved this Kata in C#.
I think the Kata description is poor/not clear. It should state clearly that error checking has to be implemented, and in case of multiple numbers with no operator in input string, the calculator should return the last number in the input string (not the first or second)?!
The problem i found is that my solution passed all sample tests, however when attempting the Kata i got two tests failing:
I could only find out that error checking has to be implemented in the way above by checking the questions section.
Please correct the description for the community.
Loading more items...