Hello, OnlineGDB Q&A section lets you put your programming query to fellow community users. Asking a solution for whole assignment is strictly not allowed. You may ask for help where you are stuck. Try to add as much information as possible so that fellow users can know about your problem statement easily.

how i use python to calculate the Golden ratio​ ​

+2 votes
asked Dec 5, 2020 by King Cook (180 points)

my answer attempt to code it

ratio = 1+5**(1/2)

print(1.618)

1 Answer

+2 votes
answered Dec 6, 2020 by xDELLx (10,520 points)

Golden Ratio Formula given below :

φ = (  1 +  √5 ) / 2 = 1.6180339887498948482045868 ...

in python , the correct code would be 

ratio = (1+5**(1/2))/2
print (ratio)

https://goodcalculators.com/golden-ratio-calculator/

Has an calculator to find the numbers satisfying Golden Ratio.Given A or B or (A+B) , it returns the other 2 numbers which would be part of the Golden Ratio.

Welcome to OnlineGDB Q&A, where you can ask questions related to programming and OnlineGDB IDE and and receive answers from other members of the community.
...