Google News
logo
Python Program to Return the value of PI
You can use the `math` module in Python to access the value of pi. Here's a program that demonstrates how to do that :
Program :
import math

pi_value = math.pi

print("The value of pi is:", pi_value)
Output :
The value of pi is: 3.141592653589793
This program imports the `math` module and then uses the `pi` constant from that module to assign the value of pi to the `pi_value` variable.

Finally, it prints the value of pi using the `print()` function.