Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

Python math.pi Constant

Python math.pi Constant

Python math Module Python math Module

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

print

(

math

.

pi

)

Output result:


3.141592653589793

Python math Module Python math Module