# "New" means new compared to previous levelclass 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
Already registered? Login
Not Account? Sign up
Enter your email address to reset your password
Back to Login? Click here