Remove object from a list of objects in python

后端 未结 7 1373
醉酒成梦
醉酒成梦 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:20

    You can remove a string from an array like this:

    array = ["Bob", "Same"]
    array.remove("Bob")
    

提交回复
热议问题