forked from tdwojak/Python2017
task02 done
This commit is contained in:
parent
b986a45879
commit
984bf73c46
14
labs03/task02.py
Normal file
14
labs03/task02.py
Normal file
@ -0,0 +1,14 @@
|
||||
#!/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)
|
Loading…
Reference in New Issue
Block a user