New course! Every coder should learn Generative AI!
Try a free lesson+ 1
How to make a simple program on fibnocci no in python
2 Answers
+ 3
Recursive:
n=int(input())
def fib(m):
if m in [0,1]:return m
return fib(m-1)+fib(m-2)
print(fib(n))
0
non recursive:
https://code.sololearn.com/cwwMCakp1rYd/?ref=app