summaryrefslogtreecommitdiff
path: root/TDD/math_utils/fibonacci.py
diff options
context:
space:
mode:
Diffstat (limited to 'TDD/math_utils/fibonacci.py')
-rw-r--r--TDD/math_utils/fibonacci.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/TDD/math_utils/fibonacci.py b/TDD/math_utils/fibonacci.py
new file mode 100644
index 0000000..0f454d6
--- /dev/null
+++ b/TDD/math_utils/fibonacci.py
@@ -0,0 +1,7 @@
+def fibonacci(n):
+ if n == 0:
+ return 0
+ elif n == 1:
+ return 1
+ else:
+ return fibonacci(n-1) + fibonacci(n-2)