python入门7-2编写函数,没有看懂
def square_of_sum(L1): L1=[] for a in L1: L1.append(a*a) return sum(L1) print square_of_sum([1, 2, 3, 4, 5]) print square_of_sum([-5, 0, 5, 15, 25]) 怎么我的是0,0.求解答
def square_of_sum(L1): L1=[] for a in L1: L1.append(a*a) return sum(L1) print square_of_sum([1, 2, 3, 4, 5]) print square_of_sum([-5, 0, 5, 15, 25]) 怎么我的是0,0.求解答
2016-11-30
举报