我对 Python 很陌生,所以我正在浏览 runestone 上的交互式指南并输入以下代码:
t = int(input("number of yrs plsz"))
a = 10000(1+(0.08/12))**12t
print(a)
我收到此错误
TypeError: 'int' object is not callable on line 2
最佳答案
10000()
是调用函数的语法 (myfunction()
)。相反,请与 *
运算符相乘。
通过使用括号,您试图调用函数 10000
,但这是无法完成的,因为 10000
是一个整数,而不是一个函数。
关于python - 类型错误 : 'int' object is not callable on line 2,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30469773/