Need Help ?

Home / Expert Answers / Other / python-language-9-9-lab-artwork-label-classes-constructors-define-the-artist-class-with-a-constructo

(Answered): Python language 9.9 LAB: Artwork label (classes/constructors) Define the Artist class with a constru ...



9.9 LAB: Artwork label (classes/constructors) Define the Artist class with a constructor to initialize an artists informationLAB ACTIVITY 9.9.1: LAB: Artwork label (classes/constructors) 8/10 main.py Load default template. 1 class Artist: 2 # TODO: D

Python language

9.9 LAB: Artwork label (classes/constructors) Define the Artist class with a constructor to initialize an artists information and a print_infomethod. The constructor should by default initialize the artist's name to 'None" and the years of birth and death to 0. printzinfo() should display Artist Name, born XXXX if the year of death is -1 or Artist Name (XXXX-YYYY) otherwise. Define the Artwork class with a constructor to initialize an artwork's information and a print_info) method. The constructor should by default initialize the title to "None", the year created to O, and the artist to use the Artist default constructor parameter values. LAB ACTIVITY 9.9.1: LAB: Artwork label (classes/constructors) 8/10 main.py Load default template. 1 class Artist: 2 # TODO: Define constructor with parameters to initialize instance attributes 3 # (name, birth_year, death_year) 4 5 # TODO: Define print_info() method. If death_year is -1, only print birth_year 6 7 8 class Artwork: 9 # TODO: Define constructor with parameters to initialize instance attributes 10 # (title, year_created, artist) 11 12 # TODO: Define print_info() method 13 14 15 if _name_ main": 16 user_artist_name = input() 17 user_birth_year = int(input()) 18 user_death_year = int(input()) 19 user_title = input() 20 user_year_created = int(input()) 21 22 user_artist - Artist(user_artist_name, user_birth_year, user_death_year) 23 24 new_artwork = Artwork(user_title, user_year_created, user_artist) 25 26 new_artwork.print_info() 27


We have an Answer from Expert

View Expert Answer

Expert Answer


Answer to 9.9 LAB: Artwork label (classes/constructors) Define the Artist class with a constructor to initialize an artists inform...

The Problem has Answer!

We have detailed solutions for you for more understanding.

View Answer