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.
A polite FYI: the comment you're replying to is nearly a decade old
Couldn't that be remedied with a comment explaining what is happening?
This comment is hidden because it contains spoiler information about the solution
I understand the codewars devs are working on that feature right now.
Slicing is a pretty common language feature in scientific computing and engineering. Python, Matlab, Mathematica, and IDL all more or less have similar slicing DSLs.
That being said, there's a rational in python 3 not to use slicing:
reversed(seq)
creates an iterator, and ifseq
is a collection with a__reverse__()
method it will wrap that instead of making a copy. So it's potentially more efficient. See the Python 3 documentation on reversed().Can you post your solution as a kumite so I can review it?
True, it's not ideal from a readability perspective, unless you have experience in slicing. I would personally avoid it, but since this syntax is part of the Python core documentation, I think anyone proficient in Python should be expected to know it.
"You would have to know what [::-1] means" -- that statement could be said for just about any programming syntax. ;)