How to get the exponential of x (e raised to the power of x) in Python

1 Answer

0 votes
import math

print(math.exp(1))
print(math.exp(-1))
print(math.exp(0))
print(math.exp(math.pi))
print(math.exp(10))


'''
run:

2.718281828459045
0.36787944117144233
1.0
23.140692632779267
22026.465794806718

'''

 



answered Oct 12, 2017 by avibootz
...