#Fibonacci.py #Fibonacci sequence: start with 1 and 1, next is sum of two previous n = int(input("Enter N ( Nth Fibonacci number): ")) FnMinus1 = 1 #0th print(FnMinus1, end=" ") Fn = 1 #1th print(Fn, end=" ") for i in range(2,n+1): #F2 thru Fn FtempI = Fn + FnMinus1 #next Fi=Fn+FnMinus1 FnMinus1 = Fn #FnMinus1 is now Fn's value Fn = FtempI #Fn is now Fi print(Fn, end=" ") print() ratio = Fn / FnMinus1 print("Ratio: ", ratio) #approaches phi, the golden ratio: sqrt(5)+1 / 2 = 1.6180339887498948482045868343656