>def gen_seq(s, e):
> x = s
> while True:
> yield x
> x += 1
> if x > e:
> raise StopIteration
>
>for i in gen_seq(2, 5):
> print i
>2
>3
>4
>5
>def fibonacci():
> a,b = 0,1
> while True:
> yield b
> a,b = b, a+b
>
>fib = fibonacci()
>next(fib)
>1
>next(fib)
>1
>next(fib)
>2