python 实现删除列表对象 源代码
时间: 2024-01-31 09:02:18 浏览: 47
Sure, I can help you with that! Here is an example code snippet in Python that demonstrates how to delete an object from a list:
```python
list = [1, 2, 3, 4, 5] # create a list
del list[2] # delete the third object (index 2) from the list
print(list) # print the updated list
```
This will output:
```
[1, 2, 4, 5]
```
I hope this helps! Do you have any other questions I can assist you with?
阅读全文