forked from tdwojak/Python2017
16 lines
264 B
Python
16 lines
264 B
Python
def Fibonacci(x):
|
|
for i in range(x):
|
|
if i==0 or i == 1:
|
|
a = 1
|
|
b = 1
|
|
yield 1
|
|
else:
|
|
temp = a
|
|
a += b
|
|
b = temp
|
|
yield a
|
|
|
|
nr = 5
|
|
|
|
for c in Fibonacci(nr):
|
|
print(c) |