May I please have your assistance with this lab: 2.15 LAB: Artwork label ( modules) Part of the code is correct. I am only needing the code to be correct for the following errors: This is the current code & errors at bottom of code: # Artist.py class Artist: # below is the comstructor to initializez artist infomration # constructor initialize the artist's name to "None" and the years of birth and death to 0 def __init__(self, name='None', birth_year=0, death_year=0): self.name = name self.birth_year = birth_year self.death_year = death_year def print_info(self): if self.birth_year >= 0 and self.death_year >= 0: print(f'Artist: {self.name} ({self.birth_year} to {self.death_year})') elif self.birth_year >= 0: print(f'Artist: {self.name} ({self.birth_year} - present)') else: print(f'Artist: {self.name} (unkown)') # Artwork.py class Artwork: def __init__(self, title= "None", year_created=0, artist=Artist()): self.title = title self.year_created = year_created self.artist = artist def print_info(self): self.artist.print_info() print(f'Title: {self.title}, {self.year_created}') # Main.py if __name__ == "__main__": user_artist_name = input() user_birth_year = int(input()) user_death_year = int(input()) user_title = input() user_year_created = int(input()) user_artist = Artist(user_artist_name, user_birth_year, user_death_year) new_artwork = Artwork(user_title, user_year_created, user_artist) new_artwork.print_info() Current Errors: 4:Unit testkeyboard_arrow_up 0 / 2 Tests Artist constructor with default param values AttributeError: 'Artist' object has no attribute 'name' 5:Unit testkeyboard_arrow_up 0 / 2 Tests that Artist('Pablo Picasso', 1881, 1973) correctly initializes artist TypeError: Artist() takes no arguments 6:Unit testkeyboard_arrow_up 0 / 2 Tests that Artist('Brice Marden', 1938, -1) correctly initializes artist TypeError: Artist() takes no arguments 7:Unit testkeyboard_arrow_up 0 / 1 Tests Artwork constructor with default param values AttributeError: 'Artwork' object has no attribute 'title' Please see attached lab and error messages. Thank you.
May I please have your assistance with this lab: 2.15 LAB: Artwork label ( modules) Part of the code is correct. I am only needing the code to be correct for the following errors: This is the current code & errors at bottom of code: # Artist.py class Artist: # below is the comstructor to initializez artist infomration # constructor initialize the artist's name to "None" and the years of birth and death to 0 def __init__(self, name='None', birth_year=0, death_year=0): self.name = name self.birth_year = birth_year self.death_year = death_year def print_info(self): if self.birth_year >= 0 and self.death_year >= 0: print(f'Artist: {self.name} ({self.birth_year} to {self.death_year})') elif self.birth_year >= 0: print(f'Artist: {self.name} ({self.birth_year} - present)') else: print(f'Artist: {self.name} (unkown)') # Artwork.py class Artwork: def __init__(self, title= "None", year_created=0, artist=Artist()): self.title = title self.year_created = year_created self.artist = artist def print_info(self): self.artist.print_info() print(f'Title: {self.title}, {self.year_created}') # Main.py if __name__ == "__main__": user_artist_name = input() user_birth_year = int(input()) user_death_year = int(input()) user_title = input() user_year_created = int(input()) user_artist = Artist(user_artist_name, user_birth_year, user_death_year) new_artwork = Artwork(user_title, user_year_created, user_artist) new_artwork.print_info() Current Errors: 4:Unit testkeyboard_arrow_up 0 / 2 Tests Artist constructor with default param values AttributeError: 'Artist' object has no attribute 'name' 5:Unit testkeyboard_arrow_up 0 / 2 Tests that Artist('Pablo Picasso', 1881, 1973) correctly initializes artist TypeError: Artist() takes no arguments 6:Unit testkeyboard_arrow_up 0 / 2 Tests that Artist('Brice Marden', 1938, -1) correctly initializes artist TypeError: Artist() takes no arguments 7:Unit testkeyboard_arrow_up 0 / 1 Tests Artwork constructor with default param values AttributeError: 'Artwork' object has no attribute 'title' Please see attached lab and error messages. Thank you.
Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
Related questions
Question
May I please have your assistance with this lab:
2.15 LAB: Artwork label ( modules)
Part of the code is correct. I am only needing the code to be correct for the following errors:
This is the current code & errors at bottom of code:
# Artist.py
class Artist:
# below is the comstructor to initializez artist infomration
# constructor initialize the artist's name to "None" and the years of birth and death to 0
def __init__(self, name='None', birth_year=0, death_year=0):
self.name = name
self.birth_year = birth_year
self.death_year = death_year
def print_info(self):
if self.birth_year >= 0 and self.death_year >= 0:
print(f'Artist: {self.name} ({self.birth_year} to {self.death_year})')
elif self.birth_year >= 0:
print(f'Artist: {self.name} ({self.birth_year} - present)')
else:
print(f'Artist: {self.name} (unkown)')
# Artwork.py
class Artwork:
def __init__(self, title= "None", year_created=0, artist=Artist()):
self.title = title
self.year_created = year_created
self.artist = artist
def print_info(self):
self.artist.print_info()
print(f'Title: {self.title}, {self.year_created}')
# Main.py
if __name__ == "__main__":
user_artist_name = input()
user_birth_year = int(input())
user_death_year = int(input())
user_title = input()
user_year_created = int(input())
user_artist = Artist(user_artist_name, user_birth_year, user_death_year)
new_artwork = Artwork(user_title, user_year_created, user_artist)
new_artwork.print_info()
Current Errors:
4:Unit testkeyboard_arrow_up
0 / 2
Tests Artist constructor with default param values
AttributeError: 'Artist' object has no attribute 'name'
5:Unit testkeyboard_arrow_up
0 / 2
Tests that Artist('Pablo Picasso', 1881, 1973) correctly initializes artist
TypeError: Artist() takes no arguments
6:Unit testkeyboard_arrow_up
0 / 2
Tests that Artist('Brice Marden', 1938, -1) correctly initializes artist
TypeError: Artist() takes no arguments
7:Unit testkeyboard_arrow_up
0 / 1
Tests Artwork constructor with default param values
AttributeError: 'Artwork' object has no attribute 'title'
Please see attached lab and error messages.
Thank you.
Expert Solution
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
This is a popular solution!
Trending now
This is a popular solution!
Step by step
Solved in 4 steps
Knowledge Booster
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.Recommended textbooks for you
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education