Skip to content

Commit

Permalink
[ADD] basic fibonacci implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
mart-e committed Jan 26, 2016
1 parent b1e2115 commit 8a2912a
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions main.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/usr/bin/env python2


def fibonacci(n):
"""inefficiant implementation of fibonacci using recursion"""
if n==1 or n==2:
return 1
return fibonacci(n-1)+fibonacci(n-2)

if __name__ == '__main__':
print fibonacci(30)

0 comments on commit 8a2912a

Please sign in to comment.