求大神告知 这个代码里面的while和for循环是如何执行的
def square_of_sum(L):
s=0
n=0
while n<len(L):
for x in L:
s=s+x*x
n=n+1
return s
print square_of_sum([1, 2, 3, 4, 5])
print square_of_sum([-5, 0, 5, 15, 25])
def square_of_sum(L):
s=0
n=0
while n<len(L):
for x in L:
s=s+x*x
n=n+1
return s
print square_of_sum([1, 2, 3, 4, 5])
print square_of_sum([-5, 0, 5, 15, 25])
2018-10-16
举报