iter with stepsize

Alan G Isaac alan.isaac at gmail.com
Wed Oct 15 23:18:49 EDT 2008


> Alan G Isaac <alan.isaac at gmail.com> writes:
>> If I have a sequence, I can get every other or every fifth
>> element by slicing.  Is there an equivalent for iterators?


On 10/15/2008 11:12 PM Paul Rubin apparently wrote:
> itertools.islice


Oh, of course.
I'm a bit embarrassed not to have thought
to look at itertools before posting.
Thanks!
Alan



More information about the Python-list mailing list