# "New" means new compared to previous level class Shape: default_color = 'violet' # New: Add class variable background_color = 'white' def __init__(self): self.color = self.default_color # New: Add...


# "New" means new compared to previous level
class Shape:
    default_color = 'violet'
    # New: Add class variable
    background_color = 'white'


    def __init__(self):
        self.color = self.default_color


    # New: Add class method
    def print_description(self):
        print(self.color, 'on', self.background_color)


a_shape = Shape()
a_shape.print_description()


a_shape.color = 'magenta'
a_shape.print_description()


Shape.background_color = 'ivory'
a_shape.print_description()



what is the output



Jun 04, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here