为什么return的位置跟sum对齐了就不对了?
def square_of_sum(list):
sum=0
for x in list:
sum = sum + (x*x)
return sum
list=[1,2,3,4,5]
print square_of_sum(list)
def square_of_sum(list):
sum=0
for x in list:
sum = sum + (x*x)
return sum
list=[1,2,3,4,5]
print square_of_sum(list)
2019-03-13
举报