I have a list of objects of the following form
a = [<__main__.Card at 0x10b47a630>,
<__main__.Card at 0x10b47aba8>,
<__main__.Card at 0x10b47ac18>,
<__main__.Card at 0x10b47a588>,
<__main__.Card at 0x10b47a0f0>,
<__main__.Card at 0x10b47a208>]
I can call a single object from the list;
print(a[0])
prints <__main__.Card at 0x10b47a630>
I would like to remove one of the objects from the list, but not using the index, but by calling the object itself.
a.remove(<__main__.Card at 0x10b47a630>) # I think that the format in the bracket is wrong
I know that I can do this with strings:
a = ['a', 'b', 'c', 'z']
a.remove('c')
a = ['a', 'b', 'z']
However, I have not figured out how to do it in this case.
I know that I can do it like this:
a.remove(a[0])
but I am not sure the form of the object that should go in .remove()
.