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)