The Python EXPM1 function is one of the Python Math function which is used to calculate the power of E (Where E is Euler’s number approximately equal to 2.71828) and subtracts One from it. In this article we will show you, How to use EXPM1() function in Python Programming language with example.

## Syntax of a Python EXPM1 Function

The basic syntax of the EXPM1 Function in Python Programming Language is as shown below:

1 |
Math.expm1(number); |

Or we can simply say * math.exp(number) – 1. *Please refer Python EXP function for further reference.

**Number:** It can be a number or a valid numerical expression.

- If the
*number*argument is positive or negative number, EXPM1() function will return the output. - If the
*number*argument is not a number, EXPM1() function will return**TypeError.**

### Python EXPM1 Function Example

The Python EXPM1 Function is used to calculate the power of Euler’s number E and subtracts One from it. In this example, We are going to check the same with different data types and display the output

**PYTHON CODE**

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
# Python EXPM1 Function import math Tup = (1.98, 20.26, 13.05, -40.95 , 0.45) # Tuple Declaration Lis = [-10.98, 3.65, -9.59, -4.15 , 5.97] # List Declaration print('EXPM1() Function on Positive Number = %.2f' %math.expm1(1)) print('EXPM1() Function on Negative Number = %.2f' %math.expm1(-1)) print('EXPM1() Function on Tuple Item = %.2f' %math.expm1(Tup[2])) print('EXPM1() Function on List Item = %.4f' %math.expm1(Lis[2])) print('EXPM1() Function on Multiple Number = %.4f' %math.expm1(10 + 20 - 15.65)) print('EXPM1() Function on String Value = ', math.expm1('3')) |

**OUTPUT**

**ANALYSIS**

- At the beginning, We declared Python List and Tuple with some random values.
- Within first two statements, We used the EXPM1() Function with both the Positive integer and negative integer values as arguments.
- Next two statements, We used the EXPM1() Function on Python Tuple and List items. If you observe the above screenshot, EXPM1() function is working perfectly on them.
- Next, We tried EXPM1() Function directly on multiple values.
- In the Last statement, We used the EXPM1() Function on String value. As we said before, this will return
as output.**TypeError**

Thank You for Visiting Our Blog

## Share your Feedback, or Code!!