当前位置:首页 > python教程 > python进阶

Python math.e 常量

python math.e 常量

python math.e 常量用于返回欧拉数 (2.7182...)。

语法

math.e 常量语法如下:

math.e
返回值

返回一个浮点数 2.718281828459045,表示数学常数 e

实例

以下实例返回欧拉数 (2.7182...):

实例

# 导入 math 包
import math

# 输出 e 的值
print (math.e)

输出结果:

2.718281828459045


【说明】本文章由站长整理发布,文章内容不代表本站观点,如文中有侵权行为,请与本站客服联系(QQ:254677821)!