def DeleteIndex ( self , index ) : to_remove = None for i in self . Items : if i . index == index : to_remove = i if to_remove : self . Items . remove ( to_remove )
how to remove from a specific index python
Remove a spent coin based on its index .
def DeleteIndex(self, index):
        """
        Remove a spent coin based on its index.

        Args:
            index (int):
        """
        to_remove = None
        for i in self.Items:
            if i.index == index:
                to_remove = i

        if to_remove:
            self.Items.remove(to_remove)