这样为啥就不行
def square_of_sum(L):
sum=0
for x in L:
x=x*x
sum+=x
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):
sum=0
for x in L:
x=x*x
sum+=x
return sum
print square_of_sum([1, 2, 3, 4, 5])
print square_of_sum([-5, 0, 5, 15, 25])
2018-12-29
举报