冒泡排序 a=[4,7,9,2,5,1] for i in range(len(a)): for j in range(len(a)-i-1): if a[j]<a[j+1]: a[j],a[j+1]=a[j+1],a[j]print(a)