📌  相关文章
📜  python 列表除了最后一个元素 - Python 代码示例

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

代码示例4
>>> some_list = [1, 2, 3]
>>> some_list[-1] = 5 # Set the last element
>>> some_list[-2] = 3 # Set the second to last element
>>> some_list
[1, 3, 5]