这道题这么写也对?(请定义一个 square_of_sum 函数,它接受一个list,返回list中每个元素平方的和。)
def square_of_sum(L): for case in L: return case*case, case=case+1 print square_of_sum([1, 2, 3, 4, 5]) print square_of_sum([-5, 0, 5, 15, 25])
这个也对???????
def square_of_sum(L): for case in L: return case*case, case=case+1 print square_of_sum([1, 2, 3, 4, 5]) print square_of_sum([-5, 0, 5, 15, 25])
这个也对???????
2017-07-17
举报