[Python] python3计算常数e →→→→→进入此内容的聊天室

来自 , 2021-04-27, 写在 Python, 查看 121 次.
URL http://www.code666.cn/view/e38e37a9
  1. import math  
  2. def e(accuracy):  
  3.     return sum(1.0/math.factorial(i) for i in range(accuracy))  
  4.  
  5. if __name__ == "__main__":  
  6.     print(e(10))  

回复 "python3计算常数e"

这儿你可以回复上面这条便签

captcha