def mopsort(li):
for i in range(1,len(li)):
for j in range(len(li)-1):
if li[j] > li[j+1]:
temp = li[j]
li[j] = li[j+1]
li[j+1] = temp
return li
temp = [333,24,76,45,1,9,65]
tempsort = mopsort(temp)
print(tempsort)
标签:for int blog range gpo body temp div turn
def mopsort(li):
for i in range(1,len(li)):
for j in range(len(li)-1):
if li[j] > li[j+1]:
temp = li[j]
li[j] = li[j+1]
li[j+1] = temp
return li
temp = [333,24,76,45,1,9,65]
tempsort = mopsort(temp)
print(tempsort)
标签:for int blog range gpo body temp div turn
原文地址:https://www.cnblogs.com/wuxinyan/p/8724376.html