python list 取倒序

2023-01-31 01:01:44 python list 取倒序
 aa=[1,2,3,4,5,]
>>> aaa=aa[::-1]
>>> aaa

[5, 4, 3, 2, 1]


>>> aaa=aa[::-2]
>>> aaa
[5, 3, 1]

相关文章