Python math.pi Constant
Python math.pi Returns the floating-point value pi, generally referring to the circle constant, PI (3.1415...).
PI: 3.141592653589793。
Syntax
The syntax of the math.pi constant is as follows:
math.pi
Return Value
Returns the floating-point number 3.141592653589793, representing the circle constant.
Example
The following example returns PI:
Example
Import the math package
import
math
Output PI
(
math
.
pi
)
Output result:
3.141592653589793
Python math Module