functional programming in python | Sololearn: Learn to code for FREE!


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))

7/24/2021 3:23:00 PM

ndatinya justin

2 Answers

New Answer


You should save your code in the code playground and link it to your question. What is the problem?


def recur_fibo(n): if n<=1: return 1 else: return(recur_fibo(n-1)+recur_fibo(n-2))