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.
epic
This comment is hidden because it contains spoiler information about the solution
doesn't work properly
This comment is hidden because it contains spoiler information about the solution
This solution was written in Python 2 about 7 years ago, where the division operator gave an integer output with integer operands. If you run this in a Python 2 interpreter (as opposed to 3, which is the default) it'll work.
This solution is wrong for it to work you have to add // I don't know how the test passed
the point is that it's not supposed to work for python3. it's supposed to work for python2. so when you determine whether it works, you have to use python2 as well.
so. it works fine. no? not broken.
you're trying to run python2 code with a python3 interpreter
i think theres nothing to do with math in this solution
It is too complicated for normal people who are not so good at math (like me).
You better do it with the '//', so you can avoid float values:
.get((s1 + s2 + s3) // 30, 'F')
that's smart
A fair point
Best practice and clever get mixed up alot from what I've seen.
Not really best practice is it (for the 45 who voted it) - only works because the grade boundaries are all divisble by 10. If one of the boundaries were [60, 64], and one were [65,70] then this would not work. Surely best practice solutions should indicate something that is easy to update as the input set changes - while almost all solutions will need to be updated if a new grade boundary is introduced, this solution will need to be fundamentally rewritten to work with boundaries not divisble by 10.
Clever, sure, but not best practice.
Loading more items...