Numerical Constants

math.pi

Approximate the ratio of a circle's circumference to its diameter. The constant is a finite float, not an exact symbolic number.

Formal Syntax & Structure

python syntaxpython
math.pi

Return Value

float

The floating-point constant described above.

Working Example

Example Snippetpython
import mathprint(round(math.pi*4, 6))
Python Reference