>>> a = [1,2,3,4,5]
最大值函数给出TypeError: 'int' object is not callable
如何在python中使用max函数?我得到的TypeError
>>> max(a)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: 'int' object is not callable
>>> max(1, 2)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: 'int' object is not callable
>>>
我敢打赌,你已经定义了一个名为'max'的变量。 – bereal
检查这个'1()'你会得到同样的错误。因为max被你创建为bereal的int变量所影响。确切地说, – The6thSense