We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 8fa0f3c commit e2cd895Copy full SHA for e2cd895
01 - Recursion/Fibonacci.py
@@ -0,0 +1,10 @@
1
+
2
+def fibonacci(number):
3
+ assert number >= 0 and int(number) == number, 'The number cannot be negative or non-integer..!'
4
+ if number in [0,1]:
5
+ return number
6
+ else:
7
+ return fibonacci(number - 1) + fibonacci(number - 2)
8
9
10
+print(fibonacci(7))
0 commit comments