Link to the project here.
The code has been working until this step, but when using the buy_artwork method the artwork doesn’t change hands nor is remove from listings.
Here’s the current code. I really don’t know why is not working.
def buy_artwork(self, artwork): if artwork in veneer.listings: art_listing = None print(art_listing) for listing in veneer.listings: print(listing) if listing.art == artwork: art_listing = listing break if art_listing != None: art_listing.art.owner = self veneer.remove_listing(art_listing) veneer = Marketplace() edytta = Client("Edytta Halpirt", None, False) moma = Client("The MOMA", "New York", True) girl_with_mandolin = art("Picasso, Pablo", "Girl with a Mandolin (Fanny Tellier)", "oil on canvas", "1910", edytta) edytta.sell_artwork(girl_with_mandolin, "$6M (USD)") veneer.show_listings() moma.buy_artwork(girl_with_mandolin) print(girl_with_mandolin) veneer.show_listings()