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.
This comment is hidden because it contains spoiler information about the solution
Comprehension lists are the definition of elegant.
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
thanks for asking so i didn't have to
what's the difference in typing [i for i, c ...] vs [i for (i, c)...] ?
That's a very nice thread you posted there, THX!
Yes, list comprehensions are considered to be more readable and thus preferable to using
filter()
andmap()
.For example, see http://stackoverflow.com/questions/5426754/google-python-style-guide
Also, iterations like
c for c in string
are preferable to using indexes likestring[i] for i in xrange(len(string))
.This comment is hidden because it contains spoiler information about the solution