1000 digits of pi in Python

前端 未结 11 1449
忘了有多久
忘了有多久 2020-11-28 10:54

I have been thinking about this issue and I can\'t figure it out. Perhaps you can assist me. The problem is my code isn\'t working to output 1000 digits of pi in the Python

11条回答
  •  失恋的感觉
    2020-11-28 11:14

    For up to 1 million digits of pi use math_pi (note: I am the author of the module)

    Install with pip:

    pip install math-pi
    

    In Python:

    >>> import math_pi
    >>> print(math_pi.pi(b=1000))
    3.1415926535...
    

提交回复
热议问题