I'm writing a generator
that takes an iterable
and an integer n
. For example if I call my generator:
generator('abcdefg',2)
then it should yield a
, d
, g
skipping 2 letters.
When I call iter(iterable)
then use yield next
the yield
automatically skips 1 letter. How would I tell python to skip yielding so I can skip n
letters?