math.exp()

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

Syntax

Loading...

e is approximately 2.718282.

Example 1

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

Loading...

Example 2

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

Loading...

Codebyte Example

Interested in helping build Docs? Read the Contribution Guide or share your feedback.

Learn Python on Codecademy