Answers for "how to find previous fibonacci number in python"

0

how to find previous fibonacci number in python

# Python3 implementation of the approach
from math import *
 
# Function to return the previous
# fibonacci number
def previousFibonacci(n):
    a = n/((1 + sqrt(5))/2.0)
    return round(a)
 
# Driver code
n = 8
print(previousFibonacci(n))
Posted by: Guest on October-01-2021

Code answers related to "how to find previous fibonacci number in python"

Python Answers by Framework

Browse Popular Code Answers by Language