Skip to content

Commit

Permalink
Merge pull request #9 from mgilangjanuar/master
Browse files Browse the repository at this point in the history
#1 add fibonacci with python
  • Loading branch information
till-tomorrow authored Oct 19, 2017
2 parents fd0f743 + 2124070 commit f53a641
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions fibonacci.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
def fibonacci(n):
if n == 0:
return 0
if n == 1:
return 1
return fibonacci(n - 1) + fibonacci(n - 2)

for i in range(0, 10):
print(fibonacci(i))

0 comments on commit f53a641

Please sign in to comment.