From 9a820d8599d7bad228d3c34b440599020aa4a386 Mon Sep 17 00:00:00 2001 From: marina <138340846+bt3gl-cryptographer@users.noreply.github.com> Date: Mon, 7 Aug 2023 17:05:59 -0700 Subject: [PATCH] Update fibonacci.py --- math/fibonacci.py | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/math/fibonacci.py b/math/fibonacci.py index 2d92d9e..6554fd0 100644 --- a/math/fibonacci.py +++ b/math/fibonacci.py @@ -2,15 +2,9 @@ # -*- coding: utf-8 -*- # author: bt3gl + def fibonacci(n): - """ Calculate the nth Fibonacci number """ + if n == 0 or n == 1: return n return fibonacci(n - 1) + fibonacci(n - 2) - - -if __name__ == '__main__': - - print('Testing fibonacci') - n = 10 - print(f'Fibonacci of {n}: {fibonacci(n)}')