Remove object from a list of objects in python

后端 未结 7 1326
醉酒成梦
醉酒成梦 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")
    
    0 讨论(0)
提交回复
热议问题