With the help of cmath.pi
constant, we can use this constant value in the calculation of area of circle, perimeter of circle and etc.
Syntax : cmath.pi
Return : Return the pi value.
Example #1 :
In this example we can see that by using cmath.pi
constant, we are able to drive the mathematical formulas very easily.
import cmath
r = 5
gfg = cmath.pi * r * r
print (gfg)
|
Output :
78.53981633974483
Example #2 :
import cmath
r = 3
gfg = 2 * cmath.pi * r
print (gfg)
|
Output :
18.84955592153876
Whether you're preparing for your first job interview or aiming to upskill in this ever-evolving tech landscape,
GeeksforGeeks Courses are your key to success. We provide top-quality content at affordable prices, all geared towards accelerating your growth in a time-bound manner. Join the millions we've already empowered, and we're here to do the same for you. Don't miss out -
check it out now!
Last Updated :
09 Sep, 2019
Like Article
Save Article