math.exp()
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 mathprint(math.exp(5))# Output: 148.4131591025766
Example 2
Use math.exp()
to return e raised to the power of 3
:
import mathprint(math.exp(3))# Output: 20.085536923187668
Codebyte Example
Contributors
- Anonymous contributors