Easy Tutorial
❮ Python String Swapcase Ref Math Atan2 ❯

Python math.pi Constant

Python math Module

Python math.pi returns a floating-point value of π, commonly known as Pi, the mathematical constant (3.1415...).

PI: 3.141592653589793.

Syntax

The syntax for the math.pi constant is as follows:

math.pi

Return Value

Returns a floating-point number 3.141592653589793, representing Pi.

Example

The following example returns Pi:

Example

# Import math package
import math

# Print PI
print(math.pi)

Output result:

3.141592653589793

Python math Module

❮ Python String Swapcase Ref Math Atan2 ❯