def fib(n, start=0):
    a, b = start, start+1
    yield a
    for i in range(n-1):
        yield b
        a, b = b, a+b

print(list(fib(5)))

Embed on website

To embed this project on your website, copy the following code and paste it into your website's HTML: