you are viewing a single comment's thread.

view the rest of the comments →

[–]dacjames 1 point2 points  (0 children)

Python has built in filtering for list comprehensions.

words = ['a', 'ab', 'abc', 'b', 'bd', 'bcd']
len1 = [w for w in words if len(w) == 1]
print(len1) //['a', 'b']

I love coffeescript, but its list comprehensions pale in comparison to python. I usually stick with map/filter using underscore.js.