"""
Simple generators
by K. Urner
4D Solutions
"""
def pascal():
"""generate rows of Pascal's Triangle"""
row = [1]
while True:
yield row
row = [i+j for i,j in zip(row + [0], [0] + row)]
def fibo():
"""generate Fibonacci sequence"""
a,b = 0,1
while True:
yield a
a,b = b, a+b