From 345bd1303be257dda12a92c8f47bfe2eebeed44b Mon Sep 17 00:00:00 2001 From: vikash yadav Date: Wed, 11 Nov 2020 02:05:17 +0530 Subject: [PATCH] a new code for fabonacci series for beginner to understand --- python/fabnonacci.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 python/fabnonacci.py diff --git a/python/fabnonacci.py b/python/fabnonacci.py new file mode 100644 index 0000000..8434abf --- /dev/null +++ b/python/fabnonacci.py @@ -0,0 +1,16 @@ +def fb(n): + + a=0 # a is the first number in fabonacci series. + b=1 # b is second number in fabonacci series . + print(a) + print(b) + """ + by printing the above condition the fabonacci series is : 0 1 1 and so till n + """ + for i in range(2,n+1): # by using for it will iterate till n + c=a+b + a=b + b=c + print(c) + +print(fb(n)) #enter the value of n in postive integer by which u want to calculate fabonacci series. \ No newline at end of file