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 still throws an error on the kata running python 3.11, and in my IDE (also running python 3.11). I checked in idle, and it throws the division by 0 error there as well, so I wonder what's different about your setup that it doesn't throw this error.
This comment is hidden because it contains spoiler information about the solution
looks like something has changed. the OP code runs fine in idle. add works fine. it throws divide by 0 error only on divide.
what does that mean?
Very interesting kata, quite challenging.
Is is amazing I wouldn't have thought of that.
python new test frameworks
I did the same thing. However I am not sure if its faster than the hardcoded solution
Thanks, I didn't know.
Hi, you need to use the spoiler flag when discussing code / methods / solutions. I have added the tag.
very clever!
This comment is hidden because it contains spoiler information about the solution
Every thing that is hard coded or using simple functions should be faster
No, it's not. In fact, over a high number of invocations of the function, it probably actually be slower (allocation + hashing + lookup vs string comparison) The point of this isn't performance, it's convenience.
This looks very nice. But could anyone tell if this is really faster than the mundane if else control flow method?
Thanks.
Loading more items...