Skip to content

Commit

Permalink
Merge pull request #121 from nickcodhackder/master
Browse files Browse the repository at this point in the history
Implemented fibonacci in python
  • Loading branch information
ravivarshney01 authored Oct 4, 2018
2 parents a2f95ef + e282077 commit e697048
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions Mathematics/fibonacci/python/fibo.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
def recur_fibo(n):
if n <= 1:
return n
else:
return(recur_fibo(n-1) + recur_fibo(n-2))
nterms = int(input("How many terms? "))

if nterms <= 0:
print("Plese enter a positive integer")
else:
print("Fibonacci sequence:")
for i in range(nterms):
print(recur_fibo(i))

0 comments on commit e697048

Please sign in to comment.