我已经进行了研究,但仍然无法弄清楚为什么会出现此错误:
TypeError: int is not callable
这是我的代码:
count = []
for row in Matrix:
count.append(row[0][0].Value)
results = map(int, count)
print max(results)
count列表包含一系列字符串整数,我将它们转换为纯整数,然后想要找到最大值,但是我收到了错误提示。
我错过了什么吗?
顺便说一下,print min(count)
正常工作...
max
的任务,试试输入print max
然后查看输出结果。 - Leon Youngprint(max)
打印的内容不是<built-in function max>
,那就意味着你以某种方式覆盖了这个名称。你是在控制台中执行代码吗?正如其他人所说,你发布的代码并没有展示问题。 - Henry Keiter