diff --git a/fib.py b/fib.py index 5cb1b2c..b78eb71 100644 --- a/fib.py +++ b/fib.py @@ -12,7 +12,11 @@ def fib_recursion(n): It uses for loop to calculate it. ''' - +def F(x): + if x == 0: return 0 + elif x == 1: return 1 + else: + return F(x-1)+F(x-2) def fib_generator(n): ''' Generator version of fibonacci.