Question: Exercise 13-1 Below are two classes that store some information about two different types of art pieces, Paintings and Sculptures. Each class has an

Exercise 13-1 Below are two classes that store some information about two different types of art pieces, Paintings and Sculptures. Each class has an instance variable containing the artist's name (a string) named artist. However, Paintings have an area in square inches (a float), whereas Sculptures have a weight in pounds (a float). Both classes also have a method too_bulky which determines whether or not the piece of art is too large to go into the gallery, though this depends on the area for a Painting, or the weight for a Sculpture. class Painting: definit_ (self, artist, area): self.artist = artist self. area = area def too_bulky (self): return self.area> 1000 class Sculpture: definit__(self, artist, weight): self.artist = artist weight self.weight def too_bulky (self): = return self.weight > 500 Write a function display_artist(artist, art_list), that takes in an artist's name (artist), and a list of objects that are a mix of Paintings and Sculptures (art_list). The function should return a new list containing only the objects which both belong to the given artist and are not too bulky. Submit your code to Gradescope in a file called ex13-1.py. Constraint: Do NOT check whether each element is a Painting or a Sculpture; due to polymorphism this check is unnecessary. Examples (note that the memory locations in the representations of the Paintings/Sculpture objects, like 0x03B553E8, will not match) You will need to copy in the Painting and Sculpture classes if you want to test with the examples below.: >>> display_artist('Pablo', [Sculpture ('Mi', 120)]) [] >>> gallery = [Sculpture ('Mi', 120), Painting('Leo', 102), Painting('Mi', 1502), Sculpture ('Mi', 700), Painting('Mi', 740), Sculpture('Mi', 50)] >>> displayed display_artist('Mi', gallery) >>> displayed [ , , ] >>> displayed [0].weight 120 >>> displayed [1] .area 740 >>> displayed [2].weight 50
Step by Step Solution
There are 3 Steps involved in it
def displayartistartist artlist return art for art in ar... View full answer
Get step-by-step solutions from verified subject matter experts
