Python Tutorial Python Advanced Python References Python Libraries

Python math - e Constant



The Python math.e constant is used to return the value of e to the available precision. It returns the value of e as 2.718281828459045.

Syntax

math.e

Parameters

No parameter is required.

Return Value

Returns the value of e to the available precision.

Example:

In the example below, math.e constant is used to return the value of e to the available precision.

import math

print(math.log(math.e))
print(math.log10(math.e))

The output of the above code will be:

1.0
0.4342944819032518

❮ Python Math Module