How can I print 1000 value of pi using the following code? Can I use range() function to this below module? | SoloLearn: Learn to code for FREE!

0

How can I print 1000 value of pi using the following code? Can I use range() function to this below module?

Code: /* * from math import pi print(pi) * */

12/13/2017 7:00:20 PM

junayeD ●_°

3 Answers

New Answer

+6

If you don't want to use your own algorithm to compute, use mpmath: http://mpmath.org/ try: # import version included with old SymPy from sympy.mpmath import mp except ImportError: # import newer version from mpmath import mp mp.dps = 1000 # set number of digits print(mp.pi) # print pi to a thousand places

+4

This won't work on SL Python environment, but should work on your own

0

it says no module such name