python中的math.e常量示例

Pythonmath.e不变

math.e常数是在数学模块中定义的预定义常数,它返回数学常数“ e”的值,该值为2.718281828459045

它的语法math.e不变:

    math.e

返回值: float-这是数学常数“ e”的值。

示例

    Input:
    print(math.e)

    Output:
    2.718281828459045

Python代码演示示例math.e不变

# python代码演示示例 
#math.econstant

# 导入数学模块
import math 

# e的打印值
print("value of e = ", math.e)

输出结果

value of e =  2.718281828459045

参考:Python数学库