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.
I agree that one-liners are hard to read and completely beginner - unfriendly, but they are just about beauty and fun. In a real life task splitting this in multiple lines is a good idea, but solving katas like this is definitely great.
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
Please stop voting best practices for solutions that cram everything into a single line of code.
You are correct. =) But I solve katas for fun, and sometimes that goes against best practises.
Putting the whole function in one line may be clever, but it's not best practices.
One-liners are much less readable when they are this long. Just write the same code in 2 or 3 lines and one can actually read it quickly and easily.
...then I thought about this one but not sure because although it uses fewer function calls it reconcatenates the string over and over. Thoughts on speed/efficiency, anyone?
thanks, I avoid
char
because I program in C for which that's a keyword, so I'm just used toc
.Nice fork. Nice way to reduce a couple lines.
I personally like using char instead of c for the variable name.
I find myself commenting on every kata solution that the goal of python is not to stuff it all into one line of code.
This code would be more readable and more pythonic if written in two or three lines.
The description of this kata is poor and it seriously needs to be improved. It is not by any means impossible, but it is not at all clear either.
It should provide an example and the generic instructions separately, not mixed together into one set. This leads to confusion of which numbers are variables and which are fixed.
It is also wrong about the depreciation rates. The description says that the percentloss by month increases at the "end" of the 2nd month. However, to get the correct answers, you must increase this value before calculating the depreciated values of the cars for the second month. This actually means the depreciation rate started at the beginning of the second month. The depreciation takes place over a whole month. If the rate changes at the end of the month, it does not begin depreciating at this rate until the next month.
This comment is hidden because it contains spoiler information about the solution
Why not split this into more than one line of code?
It will be more readable that way.
Loading more items...