# 翻转列表本身
testList = [1, 3, 5]
testList.reverse()
print(testList)
#-> [5, 3, 1]
# 在一个循环中翻转并迭代输出
for element in reversed([1,3,5]):
print(element)
#1-> 5
#2-> 3
#3-> 1
# 一行代码翻转字符串
"Test Python"[::-1]
#输出 “nohtyP tseT”
# 使用切片翻转列表
[1, 3, 5][::-1]
#输出 [5,3,1]。