为什么提示TypeError: 'int' object is not callable?
代码:
sum = 0
n = 0
L = []
while n < 100:
n = n + 1
L.append(n*n)
print sum(L)
错误提示:
Traceback (most recent call last): File "index.py", line 7, in print sum(L) TypeError: 'int' object is not callable
代码:
sum = 0
n = 0
L = []
while n < 100:
n = n + 1
L.append(n*n)
print sum(L)
错误提示:
Traceback (most recent call last): File "index.py", line 7, in print sum(L) TypeError: 'int' object is not callable
2019-04-22
举报