这段代码,为什么变量和函数重名了?
def square_of_sum(l):
n=0
k=[]
while True:
i=l(n)
n=n+1
i=i**2
k.append(i)
return sum(k)
print square_of_sum([4,6,7,9,10])
def square_of_sum(l):
n=0
k=[]
while True:
i=l(n)
n=n+1
i=i**2
k.append(i)
return sum(k)
print square_of_sum([4,6,7,9,10])
2017-01-19
举报