Is there a way to get the golden ratio, phi, in the standard python module? I know of e and pi in the math module, but I might have missed phi defined somewhere.
phi
e
pi
math
scipy.constants defines the golden ratio as scipy.constants.golden. It is nowhere defined in the standard library, presumably because it is easy to define yourself:
scipy.constants
scipy.constants.golden
golden = (1 + 5 ** 0.5) / 2
2.1m questions
2.1m answers
60 comments
57.0k users