请问为什么不对呢
def square_of_sum(L): M[] for x in L: M.append(x*x) return sum(M) print square_of_sum([1, 2, 3, 4, 5]) print square_of_sum([-5, 0, 5, 15, 25]) 请问这样为什么不对呢?
def square_of_sum(L): M[] for x in L: M.append(x*x) return sum(M) print square_of_sum([1, 2, 3, 4, 5]) print square_of_sum([-5, 0, 5, 15, 25]) 请问这样为什么不对呢?
2016-05-07
举报