How do you find the nth Fibonacci number in Python?
Solution Review : Compute nth Fibonacci Number
- def fibonacci(n):
- if n <= 1:
- return n.
- else:
- return(fibonacci(n-1) + fibonacci(n-2))
- print(Fibonacci(4))
Leading Premium Business Directory More Leads More Business Digital Marketing SEO Services
Comments
Post a Comment