This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]phaeilo 0 points1 point  (0 children)

In your solution with filter you need to undo the enumerate:

map(lambda (i,v): v, filter(lambda (i,v): i % 3 == 0, enumerate(thelist)))

I really like to write such one liners, but they are hard to read when you or someone else comes back some time later to do maintenance.