Reputation: 87
I'm trying to write this equation in Python. I'm not exactly sure what I'm getting wrong here. Using pow() instead of ** seemed to get closer to the correct answer, which is 0.0000195. Any help appreciated.
from math import e
deltaK = 25
k = 400
r = 0.0038
t = 0.0246575
q = 0.125
deltaK/pow(k, 2) * pow(e, r*t) * q
#output = 1.953308013456722e-05
Upvotes: 0
Views: 163
Reputation: 403
try
p= deltaK/pow(k, 2) * pow(e, r*t) * q
"{:.8f}".format(float(p))
it will print the answer the way you want it converting scientific to decimal
Upvotes: 1