From 984bf73c46b9adf7ff1e455219254719023e5a94 Mon Sep 17 00:00:00 2001 From: s45147 Date: Sat, 9 Dec 2017 23:16:43 +0100 Subject: [PATCH] task02 done --- labs03/task02.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 labs03/task02.py diff --git a/labs03/task02.py b/labs03/task02.py new file mode 100644 index 0000000..328f887 --- /dev/null +++ b/labs03/task02.py @@ -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) \ No newline at end of file