Remove object from a list of objects in python

后端 未结 7 1324
醉酒成梦
醉酒成梦 2020-12-09 14:20

In Python, how can I remove an object from array of objects? Like this:

x = object()
y = object()
array = [x,y]
# Remove x

I\'ve tried

7条回答
  •  时光说笑
    2020-12-09 15:01

    del array[0]
    

    where 0 is the index of the object in the list (there is no array in python)

提交回复
热议问题