Why do two have a different number of digits?
One of them is "calculated" with __str__, the other with __repr__:
>>> print repr(math.pi)
3.141592653589793
>>> print str(math.pi)
3.14159265359
printuses the return value of __str__objects to determine what needs to be printed. Just math.piuses __repr__.
How can I get the Pi value to more than decimal places without using the Chudnovsky algorithm?
You can show more numbers using format()so
>>> print "pi is {:.20f}".format(math.pi)
pi is 3.14159265358979311600
20 - .