Skip to content

Commit 2124070

Browse files
committed
till-tomorrow#1 add fibonacci with python
1 parent fd0f743 commit 2124070

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

fibonacci.py

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
def fibonacci(n):
2+
if n == 0:
3+
return 0
4+
if n == 1:
5+
return 1
6+
return fibonacci(n - 1) + fibonacci(n - 2)
7+
8+
for i in range(0, 10):
9+
print(fibonacci(i))

0 commit comments

Comments
 (0)