求問,為什么這樣編寫不對呢
def square_of_sum(L):
????F = []
? ? for i in L:
? ? ? ? a = i*i
? ? ? ? F.append(a)
? ? return sum(F)
print(square_of_sum([1, 2, 3, 4, 5]))
def square_of_sum(L):
????F = []
? ? for i in L:
? ? ? ? a = i*i
? ? ? ? F.append(a)
? ? return sum(F)
print(square_of_sum([1, 2, 3, 4, 5]))
2020-03-13
舉報
2020-03-13
結果是55啊,沒錯啊