Jussi Piitulainen <jpiit...@ling.helsinki.fi> writes: > Daniel Fetchinson writes: > > > The pattern is that the first line is deleted, then 2 lines are > > kept, 3 lines are deleted, 2 lines are kept, 3 lines are deleted, > > etc, etc. > > So, is there some simple expression in Python for this?
(item for i, item in enumerate(input) if (i + 4)%5 < 2) -- [mdw] -- http://mail.python.org/mailman/listinfo/python-list