Exponential function in Python
In this post, you will learn how to find the exponent using the Python programming language.
An exponent refers to the number of times a number is multiplied by itself. For example, 34 means we are multiplying 3 four times.
An exponential function is a mathematical function that is used in many real-world situations. It is mainly used to find the exponential decay or exponential growth or to calculate bacterial growth or decay, population growth or decline, or to compute investments, model populations and so on.
Python exp() function
Python provides a number method, exp() to calculate the exponential value with the base set to e. The function accepts an exponent value as input. The syntax of this function is -
math.exp(exponent)
Exponent function example
The given example demonstrates the usage of exp() method.
import math
print("math.exp(-35.13) : ", math.exp(-35.13))
print("math.exp(98.13) : ", math.exp(98.13))
print("math.exp(-6.89) : ",math.exp(-6.89))
print("math.exp(82.29) : ", math.exp(82.29))
print("math.exp(math.pi) : ", math.exp(math.pi))
Output of the above code:
math.exp(-35.13) : 5.53649421850571e-16
math.exp(98.13) : 4.1430245728472585e+42
math.exp(-6.89) : 0.0010179138409954387
math.exp(82.29) : 5.471330076079942e+35
math.exp(math.pi) : 23.140692632779267
Related Articles
Python Convert XML to CSV
Python Pandas Dataframe to CSV
Python Converting a CSV File to a MySQL Table
Convert Excel to CSV Python Pandas
Generate and download a CSV file in Django
Python write to csv file
Python Pandas Dataframe to CSV
Python Pandas CSV to Dataframe
Prettytable in Python
Python dict inside list
Convert dictionary to dataframe Python
Convert List to Dataframe Python
Python add list to list
Difference between tuple and list in Python
Convert Excel to CSV Python Pandas
Alphabetical order Python
Python | Generate QR Code using pyqrcode module