语法错误,L(n)=x不能分配给函数,为什么?
def square_of_sum(L):
for x in L:
n=0
x=x*x
L(n)=x
n=n+1
sum(L)
return(sum)
print square_of_sum([1, 2, 3, 4, 5])
print square_of_sum([-5, 0, 5, 15, 25])
def square_of_sum(L):
for x in L:
n=0
x=x*x
L(n)=x
n=n+1
sum(L)
return(sum)
print square_of_sum([1, 2, 3, 4, 5])
print square_of_sum([-5, 0, 5, 15, 25])
2019-04-29
举报