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.
Kata stipulates "an array with exactly 5 strings". Not great for general use, but meets the requirements of the kata.
It isn't one loop. It filters (and sorts) twice. EDIT: nevermind, I see that you're asking how one might do it in one loop.
I gotta admit, this is highly readable!
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
Nice solution! My only question is how the .sort() function is successfully sorting numerically (rather than its default - alphabetically) without a function passed to it?
This comment is hidden because it contains spoiler information about the solution
What's the point of slicing? It seems to be extra overhead and less readable.
But then you'd have to type all those quotes and commas!!
I'm curious as a beginner if your approach, which seems to ignore the intent (as the given code includes concatenation), is based on industry best practices, or simply to stick it to kata creators who write ambiguous instructions (or are these one in the same?)? Either way, it's fun to see solutions that think outside the box.
I'm not a beginner programmer, but I am learning Python, so seeing the different solutions to simple kata like this is actually quite helpful. I also love creative and humorous solutions, so nice job!!
I am not finding any documentation on callling reverse() on a string. I get the " 'str' object has no attribute 'reverse' " error. What's the syntax for that sezgo?
d
It's fun to try to figure out what is going on with solutions like this ( and probably fun to write as well! ), but the idea that someone would think this is "best practice" is pretty laughable. It is unreadable to the point of absurdity!! Good job!!
This comment is hidden because it contains spoiler information about the solution
Loading more items...