【问题标题】:TypeError: "'int' object is not callable" in python [duplicate]TypeError:python中的“'int'对象不可调用”
【发布时间】:2016-04-02 05:20:54
【问题描述】:

在 python 中,我收到此错误“TypeError: 'int' object is not callable”。我读过其他帖子,但我不知道为什么会这样。

import pdb
import numpy

b=int(raw_input("b?"))
a=int(raw_input("a?"))
c=int(raw_input("c?"))

pdb.set_trace()

sqrt= (  (b*b) - (4* (a*c)))  /(2*a)

x= -b(numpy.sqrt(sqrt))
print x

谁能告诉我这是什么问题? `

【问题讨论】:

    标签: python typeerror


    【解决方案1】:

    这段代码:

    -b(numpy.sqrt(sqrt))
    

    尝试调用函数b() 并否定结果。

    这就是你想要的:

     -b * (numpy.sqrt(sqrt))
    

    【讨论】:

    • 好的,非常感谢。
    猜你喜欢
    • 2012-06-26
    • 2015-01-29
    • 2014-03-17
    • 1970-01-01
    • 2022-11-28
    • 2015-12-19
    • 2017-09-19
    • 2012-04-03
    相关资源
    最近更新 更多