+ 1
How can I print 1000 value of pi using the following code? Can I use range() function to this below method?
Code: from math import pi print(pi)
3 Respuestas
0
from math import pi
from decimal import Decimal
print(Decimal(pi))
this output the exact value of pi stored in python, if not mistaken. I believe you will get zeros for any floating point beyond this.
0
check out this tutorial:
https://docs.python.org/2/tutorial/floatingpoint.html
- 1
just search for it online