Question: solve 9.3 LAB: Artwork label (classes/constructors) Define the Asti at class with a constructor to initialize an artist's information and a print_info() method. The constructor

solve

9.3 LAB: Artwork label (classes/constructors) Define the Asti at class with a constructor to initialize an artist's information and a print_info() method. The constructor should by default initialize the artist's name to "None" and the years of birth and death to 0. print_info() should display Artist Name, bom XXXX if the year of death is -1 or Anlist Name poc(X-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 lille to "None", the year created to 0, and the artist to use the Artist default constructor parameter values. Ex: If the input is: Pablo Pizzano 1881 1973 TheBe Musicians 1921 the output is Artist: Pablo Picasso (1881-1973) Title: Theon Musicians, 1921 If the input is: Brice Mardan 1938 Distant Nolan 1000 the output is Artist: Brice Marden, born 1938 Title: Distant Manes, 2000 LAB ACTIVITY 9.3.1: LAB: Artwork label (classes/constructors) 0/ 10 main.py Load default template.. class Artist: # TODD: Define constructor with parameters to initialize instance attributes (name, birth year, death year) " TODD: Define print_info( ) method. If death year is -1, andy print birth year class Artwork: TODD: Define constructor with parameters to initialize instance attributes (title, year_created, artist] 11 12 # TODD! Define print_info( ) method 13 15 if name " main : 16 user_artist_name = input( ) 17 user_birth year = int( input(]) 16 user_death_year - int(input(]) 19 user_title = input(} user year created = int (input( )) 21 22 23 user _artist - Artist(user_artist_name, user_birth year, user_death_year) 24 now_artwork = Artwork (user_title, user_year_created, user_artist) 25 now_artwork.print_info( ) 27

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Mathematics Questions!