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.
omg thank u soooo much
No.
Your code is doing regular division.
is this broken???
This comment is hidden because it contains spoiler information about the solution
Use built-in python integer division. And report a wrong case if it happens, not what you think could happen.
Python random tests generator has a protection against generating division by zero in the expression, and there is no fixed test with division by zero either, so...
you're not saying that the tests generate such a case. you're not using those words. if it does, that is an issue. you're being vague about where
3 4 9 / /
comes from, but I'm guessing you came up with it. which means it didn't happen in the kata. which means there is no issue to report.an issue needs to demonstrate the problem in a reproducible way. tbh, issue reviewers will probably dig more than they're willing to admit, but if your issue is incorrect and you're sharing something that's multiple steps of reasoning away from the bug itself, then the person reading your issue is not going to be making the same mistake as you and thus won't encounter anything being wrong and will therefore not "get it".
I'm guessing your code divides by zero. cool. go debug it. start by finding out what input your code fails on.
This comment is hidden because it contains spoiler information about the solution
I prepared for this kata by reading about the Postfix Mail Transfer Agent. Only after doing that did I read the kata description :P
I guess I already explained it up there, 2 / 3 with integer division is 0, 9 * 4 is 36.
3 * (4 / 9) = 0 using integer division. Please check your math.
This comment is hidden because it contains spoiler information about the solution
How are you even getting 36 from that?
Closing, because the test is fine.
See the last example:
I'd say that's a similar case. I'm tempted to close this issue, because the test is fine, and your post says it's not. Maybe ask for clarification or suggest better examples.
What you did is inserting the operators between the operands and went from left to right, that's wrong, and that's how you got 36:
((2 / 3) + 9) * 4
.That, in posfix notation would be:
2 3 / 9 + 4 *
Maybe, but that doesn't seem intuitive even if we follow the rules from the description.
Loading more items...