第二个错了 求解 为什么用字母不能替代 函 数 是我写错了吗???
def square_of_sum(L):
sum = 0
for x in L:
sum = sum + x * 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):
n(L) = square_of sum(L):
sum = 0
for x in L:
sum = sum + x * x
return sum
print n([1, 2, 3, 4, 5])
print n([-5, 0, 5, 15, 25])