math.exp()

Published May 19, 2021Updated Sep 3, 2021
Contribute to Docs

The math.exp() method returns e raised to the power of a number.

Syntax

math.exp(x)

e is approximately 2.718282.

Example 1

Use math.exp() to return e raised to the power of 5:

import math
print(math.exp(5))
# Output: 148.4131591025766

Example 2

Use math.exp() to return e raised to the power of 3:

import math
print(math.exp(3))
# Output: 20.085536923187668

Codebyte Example

Code
Output
Loading...

All contributors

Looking to contribute?

Learn Python on Codecademy