为什么会报错?我按答案写的却在python上报错?2.7版本的
>>> L=[]
>>> x=1
>>> while x<=100:
L.append(x*x)
x=x+1
>>> print sum(L)
Traceback (most recent call last):
File "<pyshell#106>", line 1, in <module>
print sum(L)
TypeError: 'int' object is not callable
>>> L=[]
>>> x=1
>>> while x<=100:
L.append(x*x)
x=x+1
>>> print sum(L)
Traceback (most recent call last):
File "<pyshell#106>", line 1, in <module>
print sum(L)
TypeError: 'int' object is not callable
2017-11-17
举报