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 | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 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 Answers
+ 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