Learn and Learn

Learn And Learn - great place for tutorials, references and how-to

Python exp() Function

exp() function exists in Standard math Library of Python Programming Language. By using this function we calculate the power of e, that is e**x

e is called Euler’s number, named after the renowned mathematician Leonhard Euler.

e is a very important popular irrational number in mathematics because it is the base of the natural logarithm (invented by John Napier). The value of e is approximately equal to 2.718281….. and so on.

Syntax of exp() in Python

The syntax of exp() function in python is:
math.exp( x )


exp() Function Parameters

x is any valid Python number (positive or negative). This parameter is required.
Note: if the x parameter is not a number, exp() function returns an error.


Python exp() Function Compatibility

Python 2.x – Yes
Python 3.x – Yes


exp() Function Return Value

exp() returns a floating point number after calculating the expression e**x.


Python exp() function Example

Output of Python exp() Function:


LearnAndLearn.com © 2018 - All rights reserved