summaryrefslogtreecommitdiffstats
path: root/fib.py
diff options
context:
space:
mode:
Diffstat (limited to 'fib.py')
-rw-r--r--fib.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/fib.py b/fib.py
new file mode 100644
index 0000000..129fb51
--- /dev/null
+++ b/fib.py
@@ -0,0 +1,5 @@
+def fib(n):
+ if n <= 2:
+ return 1
+ else:
+ return fib(n-1) + fib(n-2)