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.
That's pythonic beauty in its purest form - well done!!
This comment is hidden because it contains spoiler information about the solution
This is some kind of sport on CodeWars - write code as small as possible, regardless of how readable it is. So don't worry about that.
I think arseen tried to say the same thing :P
Thanks for the note. I assume I did not think it all the way through.
FYI: your solution fails for an input along the lines of '777777770000009'.
It's pythons way of making getters/setters. The @ symbol means the property function is used as a decorator, this is syntactic sugar for property(fget=info)(fget is the getter function). When someone wants the property named info(which was a variable initially) it returns the result of the info function instead.
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
Have you already tried your proposal? Because I just did, and I could not get it to work with sqrt(n).
Not really. It is to much code for what it is. It is also easier to make mistake this way. Reserving variable isn't memory efficient either.
Thanks for explaining!
CW like most social sites suffers from the this fatal disease, that is all.
I'm just wondering as I am scrolling trough one of my python books (which focus on best practice), but isn't this solution breaking the Python principal of "Sparse is better than dense?", because there are more then one Statement on each of those lines? And there are multiple exit points where my source tells me it's more Pythonic to keep the exit points to a minimal.
This comment is hidden because it contains spoiler information about the solution
Loading more items...