为什么这样返回sum函数不行?
def square_of_sum(L):
sum([x*x for x in L])
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([x*x for x in L])
return sum
print square_of_sum([1, 2, 3, 4, 5])
print square_of_sum([-5, 0, 5, 15, 25])
2019-06-15
举报