I was trying to complete “Veneer” Project on Python 3. When I Run the following code:
class Art:
def init(self, artist, title, medium, year, owner):
self.owner = owner
self.artist = artist
self.title = title
self.medium = medium
self.year = year
def __repr__(self):
return '%s. "%s". %s, %s, %s, %s.' % (self.artist, self.title, self.year, self.medium, self.owner.name,self.owner.location )
class Listing:
def init(self,art,price,seller):
self.art =art
self.price = price
self.seller = seller
def __repr__(self):
return '%s, %s.' % (self.art.title, self.price)
class Marketplace:
def init(self):
self.listings =
def add_listing(self,new_listing):
self.listings.append(new_listing)
def remove_listing(self,expired_listing):
self.listings.append(expired_listing)
def show_listings(self):
for item in self.listings:
print(item)
veneer = Marketplace
class Client:
def init(self, name, location, is_museum):
self.name = name
self.is_museum = is_museum
if is_museum:
self.location = location
else:
self.location = “Private Collection”
def sell_artwork(self,artwork,price):
if artwork.owner == self:
new_listing = Listing(artwork,price,artwork.owner)
veneer.add_listing(new_listing)
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)
print(girl_with_mandolin)
edytta.sell_artwork(girl_with_mandolin,"$6M USD")
veneer.show_listings
I get an Error:
Traceback (most recent call last):
File “script.py”, line 67, in
edytta.sell_artwork(girl_with_mandolin,"$6M USD")
File “script.py”, line 56, in sell_artwork
veneer.add_listing(new_listing)
TypeError: add_listing() missing 1 required positional argument: ‘new_listing’
I am unable to figure out the error. can anyone help.