Veneer Attribute Error

Hello, I’m having some trouble fixing my code…in this lesson:

Here is my code so far:

class Art:
  def __init__(self, artist, title, medium, year, owner):
    self.artist = artist
    self.title = title
    self.medium = medium
    self.year = year
    self.owner = owner

  def __repr__(self):
    return '''{artist}. "{title}". {year}, {medium}. {owner}, {location}.'''.format(artist = self.artist, title = self.title, year = self.year, medium = self.medium, owner =, location = self.owner.location)

class Marketplace:
  def __init__(self):
    self.listings = []

  def add_listing(self, new_listing):

  def remove_listing(self, old_listing):
  def show_listings(self):
    for listing in self.listings:

class Client:
  def __init__(self, name, location, is_museum): = name
    if is_museum == True:
      self.location = location
      self.location = "private collection"

  def sell_artwork(self, artwork, price):
    if artwork.owner == self:
      new_listing = Listing(artwork, price, self)
class Listing:
  def __init__(self, art, price, seller): = self
    self.price = price
    self.seller = seller

  def __repr__(self):
    return "{title}, {price}.".format(title =, price = self.price)

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)")


It’s at the string representation in the Listing class:
AttributeError: ‘Listing’ object has no attribute ‘title’

Thanks for the help!!

If you’ve narrowed it down to that string then keep working at it. You only use the .title attribute once in this class, when printing with the line Perhaps you should double-check what is.

1 Like

Thank you! I found the error. I didn’t realise I’d made a mistake there.

1 Like

You were on the way to it but it’s worth following that thread a little further. Using some basic debugging or even print is a nice way to just give yourself a little sanity check.

1 Like