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.
Here, the division operator forces the float, not the 1.0.
Evaluate 1/1 in the python interpreter.
a < b
is the same asb > a
.Hey, thanks for the feedback. Can you suggest a better and more clear description? Many thanks!
This comment is hidden because it contains spoiler information about the solution
This is great! I did something similar but somehow much longer with redundant code. I am interested though in how this and all the top solutions I looked at had some form of forcinf a float, e.g. the 1.0 in this one which also seems redundant when the division will result in a float and the the format will force 2 decimal places. Is there some functional reason for this?
TL;DR, it all depends on who you are writing the code for. Personally, I enjoyed it but wouldn't write it.
This feels like an age old argument between concise and readable code. To a complete beginner this would not be very useful or accessible. For me, knowing some JS and a week into learning Python, it is not readable but fun and interesting to dissect and understand, and it helps me to learn. Thank you. And I can easily understand that this becomes quite obvious with time.
I was wondering how to avoid the repetition. Nicely done.
No, that would lead to infinite recursion.
This comment is hidden because it contains spoiler information about the solution
Not sure if I agree. The case satement referencing each index in each when is much more readable and more immediately understandable.
This comment is hidden because it contains spoiler information about the solution
I'd be grateful if someone could exlpain how this works. I have never seen ; used in ruby before, nor come across shift.
This comment is hidden because it contains spoiler information about the solution
Love this code! So simple and to the point. Thank you.
If you have return, it is an explicit return which can be at any point in a method, but the last expression of any method is always returned as an implicit return, so no return is ever needed for the last expression in a Ruby method.
Loading more items...