python list 取倒序

发布时间:2019-07-29 10:11:21编辑:auto阅读(1690)

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

    [5, 4, 3, 2, 1]


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

关键字