📜  反向 python3 - Python 代码示例

📅  最后修改于: 2022-03-11 14:47:12.236000             🧑  作者: Mango

代码示例1
arr = [2,5,32,86,4,131,97]

# reverse without modifying input, using range:
for i in range(len(arr)-1, -1, -1):
    print(arr[i])
    
# reverse and modifying input:
arr.reverse()