我是python的新手,我的问题是当我想制作一个计算多维数据集音量的计算器时:
>>> print(int ** 3 (input ("Enter the side length: ")))
Enter the side length: 4
Traceback (most recent call last):
File "<pyshell#0>", line 1, in <module>
print(int ** 3 (input ("Enter the side length: ")))
TypeError: 'int' object is not callable
答案 0 :(得分:2)
int()
函数应该包围整个input()
函数,像这样的东西
print(int(input('Enter the side length:')) ** 3)