Skip to content

Latest commit

 

History

History
18 lines (13 loc) · 290 Bytes

70.md

File metadata and controls

18 lines (13 loc) · 290 Bytes
@author jackzhenguo
@desc 
@date 2019/4/10

70 一行代码实现列表反转

def reverse(lst):
    return lst[::-1]


r = reverse([1, -2, 3, 4, 1, 2])
print(r)  # [2, 1, 4, 3, -2, 1]
[上一个例子](69.md) [下一个例子](71.md)