14 lines
204 B
Python
14 lines
204 B
Python
|
#!/usr/bin/env python2
|
||
|
# -*- coding: utf-8 -*-
|
||
|
|
||
|
|
||
|
def fibonacci(n):
|
||
|
fn = [0, 1,]
|
||
|
for i in range(2, n):
|
||
|
fn.append(fn[i-1] + fn[i-2])
|
||
|
yield fn
|
||
|
|
||
|
|
||
|
a = fibonacci(10)
|
||
|
for i in a:
|
||
|
print(i)
|