Skip to content

Commit ebd5e43

Browse files
gauravdubey110abranhe
authored andcommitted
Create Fibonacci-Series-by-python.py
This program creates user defined Fibonacci series using recursion
1 parent 1f4e774 commit ebd5e43

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
2+
### Program to calculate fibonacci series
3+
4+
def fibo(n): // function to calculate fibonacci series
5+
if(n == 0):
6+
return 0
7+
elif(n == 1):
8+
return 1
9+
else:
10+
return(fibo(n-1) + fibo(n-2))
11+
num = int(input("Enter a number: ")) // enter number upto which you want to calculate fibonacci series
12+
for n in range(0,(num+1)):
13+
print(fibo(n),end=" ")

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy