The correct answer is here:
#function def fibonacci(n): if (n <= 0): return ("number should be positive") elif (n == 1): return(0) elif (n == 2): return(1) else: sum = fibonacci(n-1) + fibonacci(n-2) return (sum) #print result print(fibonacci(7))
#function def fibonacci(n): if n == 1 or n == 2: return 1 else: sum = n + fibonacci(n-1) return sum #print result print(fibonacci(10))
https://repl.it/@soulwolf233/fibonacci-sequence
424 questions
364 answers
99 comments
665 users