哪里错了?这样不行吗?
def square_of_sum(L):
a=0
while L[a]!=None:
b=L[a]*L[a]
sum=sum+b
a=a+1
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):
a=0
while L[a]!=None:
b=L[a]*L[a]
sum=sum+b
a=a+1
return sum
print square_of_sum([1, 2, 3, 4, 5])
print square_of_sum([-5, 0, 5, 15, 25])
2017-03-18
举报