Skip to content

Commit

Permalink
fibonnaci series using iteration
Browse files Browse the repository at this point in the history
It prints the fibbonaci series upto the Nth input term specified.
  • Loading branch information
Tuff004 authored Oct 31, 2021
1 parent ba5b45b commit 885b018
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions Python/fibonnaci series using iteration.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
def fib(n):
if n==0:
return 0
else:
if n==1:
return 1
else:
return fib(n-1)+fib(n-2)
a=int(input("enter any number"))
for i in range(a):
result=fib(i)
print(result)

0 comments on commit 885b018

Please sign in to comment.