forked from tdwojak/Python2017
Praca domowa nr 2
Rozwiązanie - Piotr Bystrzycki - nr indeksu 45146
This commit is contained in:
parent
ee29b2e399
commit
233a2250f6
13
labs03/task02.py
Normal file
13
labs03/task02.py
Normal file
@ -0,0 +1,13 @@
|
||||
def Fibogen(n):
|
||||
if n == 0:
|
||||
ret = yield 1
|
||||
if n == 1:
|
||||
ret = yield 1
|
||||
for i in range(n+1):
|
||||
ret = yield (Fibogen(n-2) + Fibogen(n-1))
|
||||
return ret
|
||||
|
||||
for i in Fibogen(4):
|
||||
print(i)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user