这个不用对list判空吗
def square_of_sum(L): sum = 0.0 if len(L) <= 0: return else: for item in L: sum = sum + item * item return sum L = [1,2,3] print square_of_sum(L)
def square_of_sum(L): sum = 0.0 if len(L) <= 0: return else: for item in L: sum = sum + item * item return sum L = [1,2,3] print square_of_sum(L)
2017-06-24
举报