<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def remove(self, pk):
 """Remove an item from the cart. Parameters pk : str or int The primary key of the item. Raises ------ ItemNotInCart """

        pk = str(pk)
        try:
            del self.items[pk]
        except KeyError:
            raise ItemNotInCart(pk=pk)
        self.update()