Computer >> Computer tutorials >  >> Programming >> Python

How to find exponential value in Python?


Exponential value of a x is xth power of e, Euler's constant which is an irrational number called Euler's number and is equal to 2.718281.

There are two ways to calculate it.

Using ** operator

>>> import math
>>> math.e**2 #math.e is defined constant in math module
7.3890560989306495

Using exp() function

>>>import math
>>> math.exp(2)
7.38905609893065