Friday, July 24, 2026
HomeLanguagesPython | sympy.S.GoldenRatio

Python | sympy.S.GoldenRatio

With the help of sympy.S.GoldenRatio value, We can directly use the value of Golden Ratio constant which is 1.618033989 or we can say that in sympy Golden Ratio constant is a singleton value.

Value of Golden Ratio constant –

Example #1 :
In this example we can see that by using singleton value of Golden Ratio constant, we are able to get the value of Golden Ratio constant.




# import sympy
from sympy import *
  
# Using sympy.S.GoldenRatio value
gfg = S.GoldenRatio.n(10) + S(20)
  
print(gfg)


Output :

21.61803399

Example #2 :




# import sympy
from sympy import *
  
# Using sympy.S.GoldenRatio value
gfg = S.GoldenRatio.n(20)
  
print(gfg)


Output :

1.6180339887498948482

Dominic
Dominichttp://wardslaus.com
infosec,malicious & dos attacks generator, boot rom exploit philanthropist , wild hacker , game developer,
RELATED ARTICLES

Most Popular

Dominic
32520 POSTS0 COMMENTS
Milvus
131 POSTS0 COMMENTS
Nango Kala
6902 POSTS0 COMMENTS
Nicole Veronica
12017 POSTS0 COMMENTS
Nokonwaba Nkukhwana
12115 POSTS0 COMMENTS
Shaida Kate Naidoo
7023 POSTS0 COMMENTS
Ted Musemwa
7265 POSTS0 COMMENTS
Thapelo Manthata
6980 POSTS0 COMMENTS
Umr Jansen
6971 POSTS0 COMMENTS