面对错误:“ TypeError:'int'对象不可调用”

时间:2020-10-26 11:00:22

标签: python

我写了这个程序来计算方形金字塔的面积。我遇到一个错误,显示:“ TypeError:'int'对象不可调用”。这是我的代码的一部分,错误在于编写公式的行中。

    elif shape3d=="5":
    prs=eval(input("Enter the value of Side of Base : "))
    prh=eval(input("Enter the value of Height : "))
    prv=(prh/3)*(prs**2)
    pra=(2*prs)((((prs**2)/4)+(prh**2))**0.5)+(prs**2)
    print("Volume = ",prv)
    print("Surface Area : ",pra)

1 个答案:

答案 0 :(得分:1)

prs是一个整数。但是在第5行中,您放了pra=(2*prs)((((prs**2)/4) ... 它是2*prs之后的第一个空心括号,使Python认为您正在调用函数。我猜您正在乘法,请在两者之间添加*