Python math.e Constant

Python math 模块Python math Module

Python math.eThe constant is used to return Euler's number (2.7182...).

Syntax

The syntax of the math.e constant is as follows:

math.e

Return Value

Returns a floating-point number 2.718281828459045, representing the mathematical constant.e。

Example

The following example returns Euler's number (2.7182...):

Example

# Import the math package
import math

# Output the value of e
print (math.e)

Output result:

2.718281828459045

Python math 模块Python math Module

Other Extensions