From c723ed6bb15381f508edb7e3c50cd5bf0c53c814 Mon Sep 17 00:00:00 2001 From: s45146 Date: Sun, 3 Dec 2017 15:14:31 +0100 Subject: [PATCH] =?UTF-8?q?Praca=20domowa=20nr=202=20Rozwi=C4=85zanie=20-?= =?UTF-8?q?=20Piotr=20Bystrzycki=20-=20nr=20indeksu=2045146?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- labs03/task03.py | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 labs03/task03.py diff --git a/labs03/task03.py b/labs03/task03.py new file mode 100644 index 0000000..8065acc --- /dev/null +++ b/labs03/task03.py @@ -0,0 +1,21 @@ +def Fibogen(n): + if n == 0: + yield 1 + if n == 1: + yield 1 + yield 1 + if n >= 2 : + i, j = 1, 1 + yield 1 + yield 1 + for k in range(2, n): + f = i + j + i = j + j = f + yield f + + +for i in Fibogen(15): + print(i) + +