+ 1

Can anyone help me with the Fibonacci code of python core. PLEASE!!!!. I have fail to reason it out. I'm a beginner in coding

Here's my code num = int(input()) def fibonacci(n): if n <= 1: return n else: return fibonacci(n-1) + fibonacci(n-2) for number in range(num): print(fibonacci(number)) Hints and critics are welcomed

22nd Jul 2021, 9:47 PM
Philippe Ezekiel
Philippe Ezekiel - avatar
3 ответов
+ 3
Can you please share your try here Just for helping us clarifying the reason of error ?
22nd Jul 2021, 9:52 PM
Ervis Meta
Ervis Meta - avatar
22nd Jul 2021, 10:07 PM
Ervis Meta
Ervis Meta - avatar
+ 1
You need to give two inputs one is the starting number and ending number. Because you didn't input a second value , the range in not completed. So, you won't get the expected output 😊 hope it helps you 😄
23rd Jul 2021, 12:52 AM
💝Kishore S💝
💝Kishore S💝 - avatar