0

Why my code is working?

num = int(input()) def fibonacci(n): #complete the recursive function if n<=1: return n else : return fibonacci (n-1)+ fibonacci (n-2) for i in range (num): print (fibonacci (num)) This code show error in line number 11 num understand it

18th May 2022, 5:31 AM
JAVID KHAN
JAVID KHAN - avatar
3 Answers
+ 1
JAVID KHAN Working or not working? Should be fibonacci(i) instead of fibonacci (num) -------------------- num = int(input()) def fibonacci(n): #complete the recursive function if n <= 1: return n else: return fibonacci (n - 1) + fibonacci (n - 2) for i in range (num): print (fibonacci (i))
18th May 2022, 5:35 AM
A͢J
A͢J - avatar
+ 1
Indentation error in line number 11 and I will do Fibonacci (I) but not working
18th May 2022, 5:40 AM
JAVID KHAN
JAVID KHAN - avatar