functional programming in python | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

functional programming in python

I have a question ,I've been asked to print fibonacci series and my code has a problem my code is def recur_fibo(n): if n<=1: return n else: return(recur_fibo(n-1)+recur_fibo(n+2)) if nterms<=0: print("please enter a positive integer") else: print("Fibonacci sequence:") for i in range(nterms): print(recur_fibo(i))

24th Jul 2021, 3:23 PM
ndatinya justin
ndatinya justin - avatar
2 Answers
0
You should save your code in the code playground and link it to your question. What is the problem? https://www.sololearn.com/post/75089/?ref=app
24th Jul 2021, 5:47 PM
Tibor Santa
Tibor Santa - avatar
0
def recur_fibo(n): if n<=1: return 1 else: return(recur_fibo(n-1)+recur_fibo(n-2))
24th Jul 2021, 5:58 PM
Amir
Amir - avatar