从小到大排序 通过练习熟悉双层for循环 """ 将列表中的元素从小到大排列 """ list01 = [4, 54, 5, 6, 7, 8, 3] for r in range(len(list01) - 1): # 0 1 for c in range(r + 1, len(list01)): # 123.. 234.. if list01[r] > list01[c]: list01[r], list01[c] = list01[c], list01[r] print(list01)