Created with 42pag.es | edit →

from mpmath import mp
mp.dps = 1000000 # set number of digits
print(mp.pi)
from mpmath import mp
mp.dps = int(input("How many digits?: ")) # ask for number of digits to set
print(mp.pi)