int object not callable error in python [closed]

心已入冬 提交于 2021-02-05 12:21:54

问题


This following section of code gave me the error

fd=((1/(sd*sqrt(6.28)))*2.718**((-1(d-average)**2))/(2*sd**2)))

This is the error

Traceback (most recent call last):
  File "C:\Users\etc
    fd=((1/(sd*sqrt(6.28)))*2.718**((-1(d-average)**2))/(2*sd**2))
TypeError: 'int' object is not callable

i cannot find where the int object is "not callable"

thanks


回答1:


You are missing the * operator after -1.




回答2:


This results from an int object that Python is trying to 'call' like so:

>>> 2*(1+3)
8
>>> 2(1+3)        #note missing *
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: 'int' object is not callable


来源:https://stackoverflow.com/questions/15015163/int-object-not-callable-error-in-python

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!