Open In App

Python | sympy.evalf() method

Last Updated : 18 Jun, 2019
Comments
Improve
Suggest changes
Like Article
Like
Report
With the help of sympy.evalf() method, we are able to evaluate the mathematical expressions.
Syntax : sympy.evalf() Return : Return the evaluated mathematical expression.
Example #1 : In this example we can see that by using sympy.evalf() method, we are able to evaluate the mathematical expressions. Python3 1=1
# Import sympy
from sympy import *

# Use sympy.evalf() method
expn = sqrt(9)
gfg = expn.evalf()

print(gfg)
Output :
3.00000000000000
Example #2 : Python3 1=1
# Import sympy
from sympy import *

# Use sympy.evalf() method
expn = sqrt(9)*cos(45)
gfg = expn.evalf()

print(gfg)
Output :
1.57596596645319

Next Article
Article Tags :
Practice Tags :

Similar Reads