直接上代码
a = [1,2,5,4,6,7,390] def maopao(a): for i in range(0,len(a)-1): for j in range(0,len(a)-1-i): if a[j]>a[j+1]: a[j],a[j+1] = a[j+1],a[j] print(a) return a maopao(a)