gpt4 book ai didi

python - 类型错误 : 'int' object is not callable on line 2

转载 作者:太空宇宙 更新时间:2023-11-03 17:41:34 30 4
gpt4 key购买 nike

我对 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/

30 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com