阅读(4336) (18)

Python3 math.e常量 - 自然常数e

2023-03-15 14:47:06 更新

  math 模块  math 模块


描述

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


语法

math.e 常量语法如下:

math.e

返回值

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


实例

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

# 导入 math 包
import math

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

输出结果:

2.718281828459045

Python math 模块  math 模块