为什么在开始不需要定义L是一个list啊
def square_of_sum(L):
L=[ ]
square_of_sum=0
for a in L:
sum=a*a
square_of_sum=square_of_sum+sum
return square_of_sum
print square_of_sum([1, 2, 3, 4, 5])
print square_of_sum([-5, 0, 5, 15, 25])
def square_of_sum(L):
L=[ ]
square_of_sum=0
for a in L:
sum=a*a
square_of_sum=square_of_sum+sum
return square_of_sum
print square_of_sum([1, 2, 3, 4, 5])
print square_of_sum([-5, 0, 5, 15, 25])
2019-03-14
举报