1、
>>> a = list(range(1,11)) ## 生成列表
>>> a
[1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
>>> a[::-1] ## 倒序排列
[10, 9, 8, 7, 6, 5, 4, 3, 2, 1]
>>> a
[1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
>>> b = []
>>> for i in reversed(a): ## 实现倒序排列
b.append(i)
>>> b
[10, 9, 8, 7, 6, 5, 4, 3, 2, 1]
2、在原列表上实现倒序排列
>>> a
[1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
>>> a.reverse()
>>> a
[10, 9, 8, 7, 6, 5, 4, 3, 2, 1]
原文:https://www.cnblogs.com/liujiaxin2018/p/14438638.html