[Python]reverse()で配列を反転するサンプル
書式
配列.reverse()
使用例
cftLst = [11, 22, 33,44,55] print("reverse result before") print(cftLst) cftLst.reverse() print("reverse result after") print(cftLst)
実行結果
# python test02.py
reverse result before
[11, 22, 33, 44, 55]
reverse result after
[55, 44, 33, 22, 11]