fabtab={}
def fabonacci(n):
fabtab[0]=0
fabtab[1]=1
for i in range(2,n+1):
fabtab[i]=fabtab[i-1]+fabtab[i-2]
print(fabtab[i])
return fabtab[n]
num=int(input("Enter the number to generate fabonacci series : "))
print("The fabonacci series are.....")
print(fabonacci(num))
print(fabtab.values())
Tuesday, 28 November 2017
Python Program to find Fabonacci
Subscribe to:
Post Comments (Atom)
Python Program to find Fabonacci
fabtab={} def fabonacci(n): fabtab[0]=0 fabtab[1]=1 for i in range(2,n+1): fabtab[i]=fabtab[i-1]+fabtab[i-2] ...
-
#include stdio.h > #include stdlib.h > #include conio.h > int arr[100], size=0; void insert_beg(); void insert_pos(); void inser...
-
#include iostream> #include conio.h > using namespace std; int main() { int n,num,first=0,middle,last; ...
-
#include iostream > #include conio.h > using namespace std; int main() { float radius; double area; ...
No comments:
Post a Comment