Python compiling pi | SoloLearn: Learn to code for FREE!

+1

Python compiling pi

I would like to calculate a designated amount of decimals, how can i store more digits of pi? https://code.sololearn.com/cTl17VzAax5x/?ref=app

1/7/2019 4:01:17 AM

Imagine Existance

2 Answers

New Answer

+3

You can use f-strings for that. For example (line 6): print(f"{pia:.16f}") # prints 16 digits after decimal point print(f"{pia:.20f}") # prints 20 digits after decimal point

+1

I hope this will be helpful: https://stackoverflow.com/questions/5231798/is-there-a-library-for-large-precision-complex-numbers-in-python