I have a list composed with my defined items, each of which has a attribute .name
t = [item1, item2]
I want to remove item from the t list according to their attribute .name
, like remove() or pop() methods. Maybe I can do something like:
t.remove(item.name=="Removed me")
Maybe I don't need to go through the whole list to filter out the item needed to be removed.
No comments:
Post a Comment