📜  反向函数python代码示例

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

代码示例4
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()