为什么一直报sum的错?这样思路有问题吗
sum=0
L=[]
def square_of_sum(L):
for i in L:
sum += i**2
return sum
print(square_of_sum([1, 2, 3, 4, 5]))
print(square_of_sum([-5, 0, 5, 15, 25]))
sum=0
L=[]
def square_of_sum(L):
for i in L:
sum += i**2
return sum
print(square_of_sum([1, 2, 3, 4, 5]))
print(square_of_sum([-5, 0, 5, 15, 25]))
2019-07-03
举报