排序
sort 正向排序
li = [1,456,21,5,657,21] li.sort() print(li)
li = [1,456,21,5,657,21] li.sort(reverse= False) print(li)
倒向排序
li = [1,456,21,5,657,21] li.sort(reverse= True) print(li)
反转
li = [1,456,21,5,657,21] li.reverse() print(li)
li = [1,456,21,5,657,21] li.sort() print(li)
li = [1,456,21,5,657,21] li.sort(reverse= False) print(li)
倒向排序
li = [1,456,21,5,657,21] li.sort(reverse= True) print(li)
反转
li = [1,456,21,5,657,21] li.reverse() print(li)