import itertools
def xfibo():
"""
a generator for Fibonacci numbers, goes
to next number in series on each call
"""
current, previous = 0, 1
while True:
yield current
# use a tuple swap
current, previous = previous, current + previous
# to get selected results of a generator function ...
print("show Fibonacci series 7 through 10:")
for k in itertools.islice(xfibo(), 7, 11):
print(k)
aW1wb3J0IGl0ZXJ0b29scwoKZGVmIHhmaWJvKCk6CiAgICAiIiIKICAgIGEgZ2VuZXJhdG9yIGZvciBGaWJvbmFjY2kgbnVtYmVycywgZ29lcwogICAgdG8gbmV4dCBudW1iZXIgaW4gc2VyaWVzIG9uIGVhY2ggY2FsbAogICAgIiIiCiAgICBjdXJyZW50LCBwcmV2aW91cyA9IDAsIDEKICAgIHdoaWxlIFRydWU6CiAgICAgICAgeWllbGQgY3VycmVudAogICAgICAgICMgdXNlIGEgdHVwbGUgc3dhcAogICAgICAgIGN1cnJlbnQsIHByZXZpb3VzID0gcHJldmlvdXMsIGN1cnJlbnQgKyBwcmV2aW91cwoKIyB0byBnZXQgc2VsZWN0ZWQgcmVzdWx0cyBvZiBhIGdlbmVyYXRvciBmdW5jdGlvbiAuLi4KcHJpbnQoInNob3cgRmlib25hY2NpIHNlcmllcyA3IHRocm91Z2ggMTA6IikKZm9yIGsgaW4gaXRlcnRvb2xzLmlzbGljZSh4ZmlibygpLCA3LCAxMSk6CiAgICBwcmludChrKQ==