python学习二十二(冒泡排序)
作者:互联网
myList=[4,1,7,0]
print(len(myList))
for i in range(len(myList)-1):#每循环一次找出最大值
for j in range(0,len(myList)-1-i):
if myList[j]>myList[j+1]:
tmp=myList[j]
myList[j]=myList[j+1]
myList[j+1]=tmp
print(myList)
标签:二十二,tmp,myList,python,len,range,冒泡排序,print 来源: https://blog.csdn.net/qq_40649097/article/details/119089916