Python: How do you insert into a list by slicing?

前端 未结 2 1876
长情又很酷
长情又很酷 2021-02-01 14:43

I was instructed to prevent this from happening in a Python program but frankly I have no idea how this is even possible. Can someone give an example of how you can slice a list

2条回答
  •  -上瘾入骨i
    2021-02-01 15:25

    To prevent this from happening you can subclass the builtin list and then over-ride these methods for details refer here

提交回复
热议问题