(TypeError:“float”对象不可调用)进行数学运算时

2024-09-24 00:35:12 发布

您现在位置:Python中文网/ 问答频道 /正文

我正在写一个代码,计算一个电子在玻尔模型中跳到不同轨道能级时的所有能级。我写了一些数学,但当我试图运行它时,它显示TypeError:'float'对象不可调用。我需要做什么?在

这是我的代码:

loopone = True
if (work == Element_symbols[0]):
energy = ((charge[0]*(0-13.6))/1)
print ('This is the energy level for the electron at the N=1 state.')
print (energy)
print ('These are all of the possible energies from the n=6 level')
nrgone = (-13.6((1/(5*5)-(1/(6*6)))))
nrgtwo = (-13.6((1/(4*4)-(1/(6*6)))))
nrgthree = (-13.6((1/(3*3)-(1/(6*6)))))
nrgfour = (-13.6((1/(2*2)-(1/(6*6)))))
nrgfive = (-13.6((1/(1*1)-(1/(6*6)))))
Energies = (nrgone, nrgtwo, nrgthree, nrgfour, nrgfive)
print (Energies)
loopone = False

Tags: the代码模型电子levelenergyprint能级
1条回答
网友
1楼 · 发布于 2024-09-24 00:35:12

我相信你的问题在这里

nrgone = (-13.6((1/(5*5)-(1/(6*6)))))

你不是说(注意乘法符号)吗?

^{pr2}$

相关问题 更多 >