How can I write 1-e^(-value1^2/2*value2^2) in Python? I don’t know how to use power operator and e. Answer You can use exp(x) function of math library, which is same as e^x. Hence you may write your code as: I have modified the equation by replacing 1/2 as 0.5. Else for Python <2.7, we’ll have to explicitly type cast the division