Facebook Page Twitter Page LinkedIn Page
× Python Tutorial Python Advanced Python Resources Python Libraries


The Python cmath.pi constant is used to return the value of 𝜋 to the available precision. It returns the value of 𝜋 as 3.141592653589793.

Syntax

cmath.pi

Parameters

No parameter is required.

Return Value

Returns the value of 𝜋 to the available precision.

Example:

In the below example, cmath.pi constant is used to return the value of 𝜋 to the available precision.

import cmath

print("Value of pi:", cmath.pi)

The output of the above code will be:

Value of pi: 3.141592653589793

❮ Python cMath Module