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 is very cool solution. I wish I guessed it
Many methods in Python take an iterable as their argument (this is usually noted in the signature description in the documentation). A generator expression is, much like a list, iterable. Therefore it is not necessary to actually construct a list (neither explicitly or via list comprehension), in fact it simply uses up more memory.
Yes, it does work without square brackets. I just checked, because I got identical solution except of square brackets I got
list()
. After removinglist()
it still works.Nice - one of those solutions that makes you say, "Of course! Why didn't I think of that?"
This comment is hidden because it contains spoiler information about the solution