From 61c352ddbb146719040eb4dc6a0e9ad3f9ff2de9 Mon Sep 17 00:00:00 2001 From: SoumyaMishra0608 <56739280+SoumyaMishra0608@users.noreply.github.com> Date: Wed, 8 Sep 2021 12:55:51 -0400 Subject: [PATCH] Adding missing 0 case so that if the input is 0, 0 is returned --- fib.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/fib.py b/fib.py index 50722c2..02ee968 100644 --- a/fib.py +++ b/fib.py @@ -6,6 +6,8 @@ Negative numbers should return None """ def fibonacci(position): + if (position == 0): + return 0 if(position == 1 or position == 2): return 1 return fibonacci(position - 1) + fibonacci(position - 2)