list = [3, 2, 1, 9, 10, 78,6] n = len(list) for i in range(n): for j in range(0,n-i-1): if list[j]> list[j+1]: list[j],list[j+1] = list[j+1], list[j] print(list)
本文来自博客园,作者:anthinia,转载请注明原文链接:https://www.cnblogs.com/anthinia/p/13840095.html