Python cmath.pi Constant
Example
Print the value of PI:
#Import cmath Library
import cmath
# Print the value of pi
print (cmath.pi)
Try it Yourself »
Definition and Usage
The cmath.pi
constant returns the value pi: 3.141592653589793.
It is defined as the ratio of the circumference to the diameter of a circle.
Note: Mathematically pi is represented by π.
Syntax
cmath.pi
Technical Details
Return Value: | A float value, 3.141592653589793, representing the mathematical constant PI |
---|---|
Python Version: | 1.5 |
Copyright 1999-2023 by Refsnes Data. All Rights Reserved.