Python

Python 配列の最後の値を取得する

配列の添字で-1を指定して取得する。

hoge_list = [0,42,-1,99]
print(hoge_list[-1]) # 99が出力される