From 31e0e185b64b3f9fd3251f26fee17cb21b7de05e Mon Sep 17 00:00:00 2001 From: Anaa29 <92617694+Anaa29@users.noreply.github.com> Date: Sun, 31 Oct 2021 21:55:53 +0530 Subject: [PATCH] Create fib.py --- fib.py | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 fib.py diff --git a/fib.py b/fib.py new file mode 100644 index 0000000..c49a392 --- /dev/null +++ b/fib.py @@ -0,0 +1,6 @@ +def fib(n): + if (n==1 or n==2): + return 1 + else: + return fib(n-1)+fib(n-2)#recursion step +print(fib(5))#printing 5th elemnet in fibonacci series using recursion