From c2587c76f1b416cdbecb979e54941933246bf856 Mon Sep 17 00:00:00 2001 From: Skip Montanaro Date: Tue, 16 Feb 2021 20:14:16 -0600 Subject: starting over --- doc/fibo.py | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'doc/fibo.py') diff --git a/doc/fibo.py b/doc/fibo.py index e8cafa8..83b8e83 100644 --- a/doc/fibo.py +++ b/doc/fibo.py @@ -1,15 +1,15 @@ # Fibonacci numbers demo -def fib(n): # write Fibonacci series up to n - a, b = 0, 1 - while b <= n: - print b, - a, b = b, a+b +def fib(n): # write Fibonacci series up to n + a, b = 0, 1 + while b <= n: + print b, + a, b = b, a+b def fib2(n): # return Fibonacci series up to n - ret = [] - a, b = 0, 1 - while b <= n: - ret.append(b) - a, b = b, a+b - return ret + ret = [] + a, b = 0, 1 + while b <= n: + ret.append(b) + a, b = b, a+b + return ret -- cgit v1.2.3